mivate
06-08-2006, 03:50 PM
Hello I have a multiD array and I want to remove one array item from
another inner array..splice works fine for me with just a 1D array..but with the Multi I also get [x][y] has no properties..can someone explain what I am doing wrong pls?
Code is here:
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);
}
another inner array..splice works fine for me with just a 1D array..but with the Multi I also get [x][y] has no properties..can someone explain what I am doing wrong pls?
Code is here:
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);
}