title: Javascript Append JSON Objects
body: <p>How can I append a <strong>JSON like structure</strong> while iterating through a <strong>for loop?</strong></p>
  
  <p>For Example (Pseudo Code):</p>
  
  <pre><code>var i;
  for (i = 0; i &lt; clients.length; i++) { 
      date = clients.date;
      contact = clients.contact;
  }
  </code></pre>
  
  <p>My main goal is to append as many groups of: dates and contacts as the clients.length data holds.</p>
  
  <p>I need each loop iteration to create something like below of multiple indexes of date and contact groups. My overall goal is to have a data structure like below created through my for loop.</p>
  
  <p>Assume im just using strings for: "Date" &amp; "Contact"</p>
  
  <pre><code> var data = [
      {
          "Date": "2015-02-03",
          "Contact": 1
      },
      {
          "Date": "2017-01-22",
          "Contact": 2
  
      }
  ];
  </code></pre>