title: Pushing values in a 2-dimensional array in a for loop in Javascript
body: <p>I have the following situation in Javascript
  I want the end result of the nested loop to be the following:
  testArray[,[0,0,0,0],[1,1,1,1],[2,2,2,2],[3,3,3,3]] 
  but push doesn't seem to work nor does splice. I don't want to create any intermediate arrays because <strong>row</strong> &amp; <strong>j</strong> are database driven and their values are actually unknown.</p>
  
  <pre><code>var testArray = [[3],[4]]; // or new Array(3,4);
  
  for (var row=0; row&lt; 3; row++)
    {
      for (var j=0; j&lt; 4; j++)
         {
           testArray[j,row].push(j); //?
           testArray.splice([j,row],0,j); //?
   }
  }
  </code></pre>