Menu
I have a multidimensional array and I want to delete an item from one of the inner arrays. I have no problem using splice on 1D array but when I try with 2D I get [x][y] has no properties error..but the obj is there and I put in a var…Here is my test code..can someone please advise?
Thanks in advance!
var a = [0,1,2,3,4,5,6,7,8,9];
var b = [
[0,1,2,3],
[‘a’, ‘b’, ‘c’]
];
function show(){
alert(a);
}
function editArray(){
show();
a.splice(2, 1);
show();
}
function editArray2(){
alert(b);
b.splice([0][1], 1);
alert(b);
}