I recently received a suggestion on this question to create a two-dimensional array in my jQuery quiz application. However, I seem to be encountering an error while running the code. I suspect the issue might be due to incorrect formatting or a lack of initialization.
Uncaught TypeError: Cannot set property '1' of undefined
Below is a snippet of my current code:
var answers = [];
answers [0] = [];
answers[0][1] = accept; answers[0][2] = wrong; answers[0][3] = wrong;
answers[1][1] = wrong; answers[1][2] = best; answers[1][3] = wrong;