title: push new object to array, the last object overwrite the whole array
body: <p>I try to push some object inside a loop, the first three is ok but when it want to push the last one, the whole array will overwrite by the last object! </p>
  
  <p>let's say I have this code, in my tasks, I have 4 items which 3 of them have <code>"type1"</code> type, and only one of them have <code>"type2"</code> , basically the second if only trigger once, but for some reason, at the end <code>myArray</code> fill with the last push! : </p>
  
  <pre><code>var myArray = [];
  for(var i = tasks.length-1; i&gt;=0; i--){
     if (tasks[i].type == 'type1') {
       myObject.type= 'audio',
       myObject.command = audioArgs;
       myArray.push(myObject);
     } 
     if (tasks[i].type == 'type2') {
       console.log("Before push type2: ", myArray) // Here I will get the currect value
       myObject.type= 'video',
       myObject.command = videoArgs;
       myArray.push(myObject);
       console.log("After push type2 : ", myArray) // Here all old value which have type1 will overwrite with type2
     }
  }
  </code></pre>
  
  <p>and I define the <code>myObject</code> as : </p>
  
  <pre><code>var myObject = {
    type : String,
    command : String
  }
  </code></pre>