var arr = [[],[]];
var si = 5;
var c = 0;
if (arr[si][c] == null)
{
arr[si][c] = {
code : "Test",
};
}
alert(arr[si][c].code);
Hello, I am trying to run this sample code but I am getting an error, saying that the attribute "0" of an undefined can not be called.
The awkward thing is that if I use numeric values instead of the variables "si" and "c" for the index, the error doesn't show up!
Is it possible that in JS you can not use variables as an Index? I think it does work with a non two dimensional array.
Thank you and best regards