title: How to get the number of columns of a 2dimension array in javascript?
body: <p>I have a 2 dimensional array <code>albumPhotos[x][y]</code>. The rows are <code>photoalbums</code> and the columns are <code>links to photos</code>.</p>
  
  <p>Now every <code>photoalbum</code> has a different number of <code>photos</code> , that means that every <code>row</code> in this array has a different number of <code>columns</code>.</p>
  
  <p>I am trying to check whats the length of every row in this array , that means how many columns every row has. How can i do that in javascript?</p>
  
  <p>I tried :</p>
  
  <pre><code>for(var i=0; i&lt; numberOfRows ; i++)
      for(var x=0; x &lt; albumPhotos[i].length; x++) ...
  </code></pre>
  
  <p>but apparently this is wrong command in javascript. Then i tried something like this :</p>
  
  <pre><code>for(var i=0; i&lt; numberOfRows ; i++)
      for(var x=0; x &lt; albumPhotos.rows[i].cells.length; x++)
  </code></pre>
  
  <p>but it seems wrong again. I think this is for html tables and not for arrays.</p>
  
  <p>Any ideas?</p>