title: Duplicate object multiple times based on array length - Angular 2+/ JavaScript
body: <p>I have an object with empty values. I need to duplicate this object however many times the length of one of my arrays is. So then I would have two objects with the same properties but with different values. </p>
  
  <p>TS</p>
  
  <pre><code>add = [
      {
        type: 'Package',
        value: ''
      }
  ]
  
  this.form.value.packages = [1,2,3]
  
  //This should duplicate the object based on length of packages
  
  let packageDup = Array(this.form.value.packages.length).fill(this.add[0])
  
  packageDup.forEach((res, i) =&gt; {
  
       packageDup[i].value = this.form.value.packages[i]
  
  })
  </code></pre>
  
  <p>The issue with this method is that the values end up being the same. For instance, both object's value would be equal to 2. I feel like I'm overthinking this one. Thanks.</p>
  
  <p>What I would like as a result --- </p>
  
  <pre><code>add = [
          {
            type: 'Package',
            value: '1'
          },
          {
            type: 'Package',
            value: '2'
          }, 
          {
            type: 'Package',
            value: '3'
          }
      ]
  </code></pre>