title: push() a two-dimensional array
body: <p>I'm trying to push to a two-dimensional array without it messing up, currently My array is:</p>
  
  <pre><code>var myArray = [
  [1,1,1,1,1],
  [1,1,1,1,1],
  [1,1,1,1,1]
  ]
  </code></pre>
  
  <p>And my code I'm trying is:</p>
  
  <pre><code>var r = 3; //start from rows 3
  var c = 5; //start from col 5
  
  var rows = 8;
  var cols = 7;
  
  for (var i = r; i &lt; rows; i++)
  {
      for (var j = c; j &lt; cols; j++)
      {
          myArray[i][j].push(0);
      }
  }
  </code></pre>
  
  <p>That should result in the following:</p>
  
  <pre><code>var myArray = [
  [1,1,1,1,1,0,0],
  [1,1,1,1,1,0,0],
  [1,1,1,1,1,0,0],
  [0,0,0,0,0,0,0],
  [0,0,0,0,0,0,0],
  [0,0,0,0,0,0,0],
  ]
  </code></pre>
  
  <p>But it doesn't and not sure whether this is the correct way to do it or not.</p>
  
  <p>So the question is how would I accomplish this?</p>