title: Uncaught TypeError: Cannot set property '0' of undefined "
body: <p>i'm getting the error </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot set property '0' of undefined</p>
  </blockquote>
  
  <p>for some reason in this line </p>
  
  <pre><code>world_map_array[i][z]="grass.gif|ongrass.gif|collision.gif|above.gif";
  </code></pre>
  
  <p>Why is this happening?</p>
  
  <p>thanks for any help</p>
  
  <pre><code>var x_world_map_tiles = 100; 
  var y_world_map_tiles = 100; 
  
  var world_map_array = new Array(x_world_map_tiles);
  for (i=0; i&lt;=2; i++)//create a two dimensional array so can access the map through x and y coords map_array[0][1] etc.
  {
  world_map_array[i]=new Array(y_world_map_tiles);
  }
  
  
  for (i=0; i&lt;=x_world_map_tiles; i++)//just a test
  {
  for (z=0; z&lt;=y_world_map_tiles; z++)//just a test
  {
  world_map_array[i][z]="grass.gif|ongrass.gif|collision.gif|above.gif";
  }
  }
  </code></pre>