title: Javascript array with for loop, returns only last element
body: <p>I have a <code>for</code> loop, that adds data into an <code>array</code>.
  but when I <code>console.log</code> the array, it is full of the last item of the <code>for</code> loop!</p>
  
  <p>Here is my code :</p>
  
  <pre><code>var materialsData = results[1].data, // results[1].data is a http.get return
  ln = Object.size(materialsData),
  materials = [],
  material = {};
  material['Product'] = {};
  
  for (var i = 0; i &lt; ln; i++) {
      material.Product['Name'] = materialsData[i].Product.Name;
      material.Product['Id'] = materialsData[i].Product.Id;
      material.StartingDate = materialsData[i].StartingDate.replace("T00:00:00", "").split('-').reverse().join('-');
      material.Device = materialsData[i].Device;
      materials.push(material);
  }
  </code></pre>