Hi, i have a 2D array animal and i want to copy it to another 2D array myArray. can somehelp? the code below is not working. I am havine this error :
Uncaught TypeError: Cannot set property '0' of undefined on line 7
var test="";
var myArray=new Array(animal.length);
for (y=0;y<animal.length;y++){
myArray=new Array(animal.length);
for(x=0;x<animal.length;x++){
test=""+animal[y][x].text;
myArray[y][x]=test;
}
}
alert(myArray);