title: How to put a JSON string (with multiple objects in it) into a JavaScript variable
body: <p>I have this JSON with multiple objects and this JSON string might come with more data/objects than 3. So, whatever the information is, I need to create an array of objects.</p>
  
  <pre><code>[ {"endDate":"2017-04-18","nrC":2,"type":"CO","dataD":"2017-04-19","startDate":"2017-04-16"},  
    {"endDate":"2017-04-27","nrC":4,"type":"CP","dataD":"2017-04-23","startDate":"2017-03-26"},  
    {"endDate":"2017-04-27","nrC":7,"type":"CA","dataD":"2017-04-23","startDate":"2017-04-26"}
  ]
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>var USER_DAYS = {};
  
  for(var i=0;i&lt;json.length;i++){   
      var USER_DAYS = [  
        {
            id: json[i].nrC,
            date: json[i].dataD,
            title: json[i].type,
            start: new Date(json[i].startDate),
            end: new Date(json[i].endDate),
            allDay: true
        },            
      ];
  
      console.log(i); // prints 1,2,3
  }
  
  console.log(USER_DAYS) //prints the last object from that json.
  </code></pre>
  
  <p>In that JavaScript variable must be an array with <em>n</em> objects, and when I try to print it, it should print 3 Objects instead of 1 Object. Right now my console shows only one, the last one.</p>
  
  <p>I need the <code>USER_DAYS</code> variable to contain all objects from that JSON.</p>