Can someone show me the javascript I need to use to dynamically create a two dimensional Javascript Array like below?
desired array contents:
You don't need to keep track of array lengths yourself; the runtime maintains the ".length" property for you. On top of that, there's the .push()
method to add an element to the end of an array.
// ...
innerArray.push($(this).text());
// ...
outerArray.push(innerArray);
To make a new array, just use []
:
innerArray = []; // new array for this row
Also "outer" has only one "t" :-)