title: Javascript Array and Object
body: <p>I have two arrays of objects.Where each object has different properties, Like this</p>
  <pre><code>    let array1=[
      {id:121122,name:&quot;Matt Jeff&quot;},
      {id:121123,name:&quot;Philip Jeff&quot;}, 
      {id:121124,name:&quot;Paul Jeff&quot;}]
      
      let array2=[
      {owner_id:121122,id:1211443,value:18},
      {owner_id:121127,id:1211428,value:22}]
  </code></pre>
  <p>How can I check if the owner_id in the array2 is equal to the id in array1 then return the new array like this</p>
  <pre><code>let newArray=[
  {owner_id:121122,id:1211443,value:18}
  ]
  </code></pre>
  <p>Where the owner_id in array2 is equal to the id in array1.</p>