How to add new data from array of string to array of object sequentially?
<p>Suppose I have array of object:</p>

<pre><code>originalData = [
  {
    "id": 1
  },
  {
    "id": 2
  },
  {
    "id": 3
  },
  {
    "id": 4
  },
  {
    "id": 5
  },
  {
    "id": 6
  }
]
</code></pre>

<p>And I have array of string:</p>

<pre><code>newData = ['1','2','3']
</code></pre>

<p>How do I push <code>newData</code> to <code>originalData</code> sequentially?</p>

<p>Expected result should be like so:</p>

<pre><code>originalData = [
  {
    "id": 1,
    "color":'1'
  },
  {
    "id": 2,
    "color":'2'
  },
  {
    "id": 3,
    "color":'3'
  },
  {
    "id": 4,
    "color":'1'
  },
  {
    "id": 5,
    "color":'2'
  },
  {
    "id": 6,
    "color":'3'
  }
]
</code></pre>

<p>Here's my workaround:</p>

<pre><code>originalData.forEach(function (object,i) {
    object.color = newData[i]
});
</code></pre>