title: Cannot set property 'value' of undefined
body: <p>Hy, 
   I am stuck with the following error: </p>
  
  <p>'Uncaught typeError: Cannot set property '5' of undefined'</p>
  
  <p>the code being this:</p>
  
  <pre><code>    function blank2dArray( width,height) 
      { 
         var result=[[]];//matrix
        for(var i=0;i&lt;width;i++) 
        {
            result[i]=new Array(height);
        } 
        return result; 
      }
  
  
   function generate()
      {
         var r=blank2dArray(width,height);  //generates a blank matrix
         for(var i=0;i&lt;across.length;i++) 
         { 
           var word=across[i]; 
           for(var j=0;j&lt;across[i].length;j++) 
           { 
             r[ax[i]+j][ay[i]]=word[j]; //at some point ay[i]=5
           } 
         }
      }
  
  across-it is an array of words;
  ax-array of numbers
  ay-array of numbers
  </code></pre>
  
  <p>If I replace ax[i] and ay[i] with  any number, it looks like it works. But this is not the way it is supposed to act.
  Thank you.</p>