title: How to reassign an object so that it changes the referenced object as well?
body: <p>Let's say I have an array of objects: </p>
  
  <pre><code>var people = [
    {name: "Jack", height: 180},
    {name: "Marry", height: 170},
    {name: "Susan", height: 162},
  ]
  </code></pre>
  
  <p>If I take the first person and change the height like this: </p>
  
  <pre><code>var jack = people[0];     
  jack.height = 163;
  </code></pre>
  
  <p>Then this change is reflected in the object in the array as well like this:</p>
  
  <pre><code>people = [
        {name: "Jack", height: 163},
        {name: "Marry", height: 170},
        {name: "Susan", height: 162},
      ] 
  </code></pre>
  
  <p>However if I reassign the object like this </p>
  
  <pre><code> jack = {name: "Jack the developer", height: 163}
  </code></pre>
  
  <p>The array doesn't change:</p>
  
  <pre><code>people = [
        {name: "Jack", height: 163},
        {name: "Marry", height: 170},
        {name: "Susan", height: 162},
      ] 
  </code></pre>
  
  <p>How should I assign <code>jack</code> so that it changes the reference?</p>