title: Building data into a multidimensional array in JavaScript
body: <p>I'm trying to rebuild data structure from an existing JSON file.
  For the sake of example, I trimmed all the unnecessary code:</p>
  
  <pre><code>var entries = [
    {
      "band": "Weezer",
      "song": "El Scorcho"
    },
    {
      "band": "Chevelle",
      "song": "Family System"
    }
  ]
  
  var rows = {};
  
  for (var i = 0; i &lt; entries.length; ++i) {
  
      var entry = entries[i];
  
      var t = "a";
      for (var key in entry) {
              rows[t] = t;
              t = t+"1";
      }    
      $("#agenda").append(JSON.stringify(rows));
  
  }
  $("#agenda").append("&lt;br /&gt;&lt;br /&gt; In the end, it only shows the last one:&lt;br /&gt;");
  $("#agenda").append(JSON.stringify(rows));
  </code></pre>
  
  <p>There's also a fiddle that shows it better: <a href="http://jsfiddle.net/84w6F" rel="nofollow">http://jsfiddle.net/84w6F</a>
  The aim of this example is to try and rebuild the data in "entries" to be exactly the same, by calling both the key and the value as variables.
  For some reason, I end up with a mess , and in the end when I try to read the array after the loop, it shows me only the last sub array.</p>