title: count the number of rows in 2d array
body: <p><strong>Description:</strong></p>
  
  <p>I am adding the data in my 2D array like the following </p>
  
  <pre><code>my_2d_array['user1'] = {'id':name,'socket':socket};
  my_2d_array['user2'] = {'id':name,'socket':socket};
  </code></pre>
  
  <p>This 2D array keeps the record of all the connected users id and their respective sockets ... 
  I want to display the number of users connected .. So far to do that would be to count the number of rows in the array and display it</p>
  
  <p><strong>I have tried following:</strong></p>
  
  <pre><code>my_2d_array[].length; // this gives nothing 
  my_2d_array.length; // this outputs 0 (as number)
  </code></pre>
  
  <p>What should I do to get the number of rows </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I declared my array like this </p>
  
  <pre><code>var my_2d_array = [];
  </code></pre>