title: Populating 2D Array in JS
body: <p>I am trying to popoulate a 2D array using Firebug API, </p>
  
  <pre><code>var sites = [];
      var siteCounter = 0;
  
      //Firebase API Calls
  
      var messageListRef = new Firebase('https://my.firebaseio.com');
      messageListRef.once('value', function(allMessagesSnapshot) {
        allMessagesSnapshot.forEach(function(messageSnapshot) {
          var latitude = messageSnapshot.child('latitude').val();
          var longitude = messageSnapshot.child('longitude').val();
          sites[siteCounter][0] = 'siteCounter';
          sites[siteCounter][1] = latitude;
          sites[siteCounter][2] = longitude;
          sites[siteCounter][3] = siteCounter;
          sites[siteCounter][4] = 'This is siteCounter.';
  
          siteCounter++;
          alert(sites[siteCounter][1]  + " " + sites[siteCounter][2] );
        });
      });
  </code></pre>
  
  <p>But this breaks for sites[siteCounter][0] and says it is undefined. Any clue how to work with this ?</p>