title: Issue with Matching Id between two objects
body: <p>Why <code>param</code> has been generated too many objects when it should be 4 objects max. It should match Id between <code>dbData.Items[dbItemIndex].Id == lineId</code> and store meta data in <code>param</code> including <code>dbData</code> array Index.</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>const dbData = {
      Items: [
          {Id: 111},
          {Id: 222},
          {Id: 333},
          {Id: 111},
      ]
  }
  
  const sentPayload = {
      Lines: [
          {LineId: 111},
          {LineId: 222},
          {LineId: 333},
          {LineId: 111},
      ]
  }
  
  function updateDbSent() {
      const param = [];
  
      sentPayload.Lines.forEach((line) =&gt; {
          let lineId = line.LineId
  
          for (const dbItemIndex in dbData.Items) {
              if (dbData.Items[dbItemIndex].Id == lineId) {
                  param.push({
                      Index: dbItemIndex,
                      Sent: true,
                      Id: lineId,
                  })
              }
          }
      });
      
      //update db
  
      console.log(param);
  }
  
  updateDbSent()</code></pre>
  </div>
  </div>
  </p>
  
  <p>I expected to be:</p>
  
  <pre><code>[
    {
      "Index": "0",
      "Sent": true,
      "Id": 111
    },
    {
      "Index": "1",
      "Sent": true,
      "Id": 222
    },
    {
      "Index": "2",
      "Sent": true,
      "Id": 333
    },
    {
      "Index": "3",
      "Sent": true,
      "Id": 111
    }
  ]
  </code></pre>