I am trying to set a multi-dimensional array in JavaScript but it returns the last entry for all data. I am expecting the alert to return 444 but it returns 555.
Any ideas?
function test() {
var arr = [,];
arr[1]="qtest0";
arr[1,0]=444;
arr[2,0]=555;
arr[2]="qtest1";
alert(arr[1]);
alert(arr[1,0]);
}
arr[1,0]and the others like it to do? You're basically only accessing the index after the comma. The index before is ignored.[[1,2],[3,4],[[5,6],[7,8]]]yours isI dont know where you learned that fromarray