Why can’t I assign: myArray[1][0] = “de beer”;?
Error says: “1” is null or not an object…
function showArr() { var myArray = Array(Array()); myArray[0][0] = “michelle”; myArray[1][0] = “de beer”; alert(myArray[1][0]); }
function showArr() { var myArray = new Array(); myArray[0] = new Array("michelle", "de beer"); alert(myArray[0][0]); // michelle alert(myArray[0][1]); // de beer }
var myArray = Array(Array()); only created the zeroeth element as 2-dimensional. QUOTE] So, how do I create a 2-dimensional array that can carry the values: myArray[0][1] = "michelle"; myArray[1][1] = "de beer"; etc... // Michelle
Help @michelle spread the word by sharing this article on Twitter...