title: Why my properties value in my object are duplicated?
body: <p>I created an object &quot;str&quot;, which has properties &quot;company&quot;,&quot;CEO&quot;,&quot;employees&quot;.</p>
  <p>As you can see, in properties employees, I created an array containing two objects and both of them have two key/value pairs: <strong>&quot;name&quot;: &quot;Duke&quot;</strong> and  <strong>&quot;age&quot;: 10</strong>.</p>
  <p>I want to change the propert &quot;<strong>name</strong>&quot;, in the first object has value &quot;Hello&quot; and in the second object is &quot;Hi&quot; but both of two properties have the value &quot;Hi&quot;. So why my code does not work ?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// create the values of key "employees"
  var employee =[];
  var name_age={
  "name":"Duke",
  "age":10
   };
  for(i=0;i&lt;2;i++){
   employee.push(name_age);
  }
  
   // create object str
   var str = {
  "company": "facebook",
  "CEO": "Mark Zuckerberg",
  "employees":employee
   };
  str.employees[0].name="Hello";
  str.employees[1].name="Hi";
  console.log(str);</code></pre>
  </div>
  </div>
  </p>
  <p>Thanks so much</p>