title: creating Object with different data
body: <p>I was wondering if there's a way to create an object with changeable data.</p>
  
  <p>Eg: </p>
  
  <pre><code>pearson = {
    name: "",
    age: 0
  }
  </code></pre>
  
  <p>Can I do something like a loop that each time it changes these 2 variables and assign the whole object with the data into an array, but each time the object will hold the updated data?</p>
  
  <p>Something like:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    let pearson = { name: '', age: 20 }
      const pearsonsList = [{name: 'dave', age: 20}, {name: 'jessy', age: 30}]
      let arr = []
      pearsonsList.forEach((e) =&gt;{
        pearson.name = e.name
        pearson.age = e.age
        arr.push(pearson)
      })
      console.log(arr[0])
      /* this what arr[0] holds
      {
     "name": "jessy",
     "age": 30
     }*/</code></pre>
  </div>
  </div>
  </p>
  
  <p>how to make arr[0] have a different value than arr[1] where the object data always get overridden ?</p>