title: change value of multi-dimensional array
body: <p>I want to change a value of a multi-dimensional array, but this code keeps telling me 
  "cannot set property '5' (which is the length of the array I guess) of undefined"</p>
  
  <pre><code>obj.figures = new Array(
  new Array(6,5,5,5,6,5,5),
  new Array(5,0,0,0,5,0,0),
  new Array(5,5,5,5,5,5,5),
  new Array(0,1,1,1,0,2,2),
  new Array(0,1,0,1,0,2,0)
  );
  
  function change() {
  for(var y = 0; y&lt;obj.figures.length; y++) {
      for(var x = 0; x&lt;obj.figures[y].length; x++) {
          $(y+","+x).addEventListener("click", function() {
              console.log(this.id);
              obj.figures[y][x] = 5;
              }, false);
          }
      }
  }
  </code></pre>