title: Find array of objects in next array to replace
body: <p>I have two below arrays objects. I want to find all those IDs of first array, and make them active in second array of object, and the rest will have to become none at status properties.</p>
  <pre><code>var searchIDs = [{ &quot;id&quot;:&quot;6001&quot;, &quot;other&quot; : &quot;...&quot; }, 
  { &quot;id&quot;:&quot;6002&quot;, &quot;other&quot; : &quot;...&quot;}] 
  
  var list = [ 
      {&quot;id&quot;:&quot;9666&quot;, &quot;status&quot;:&quot;active&quot;},
      {&quot;id&quot;:&quot;9667&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;9999&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;9668&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;9669&quot;, &quot;status&quot;:&quot;active&quot;},
      {&quot;id&quot;:&quot;6001&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6002&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6003&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6004&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6005&quot;, &quot;status&quot;:&quot;active&quot;},
      {&quot;id&quot;:&quot;6006&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6007&quot;,  &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6008&quot;,  &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6009&quot;,  &quot;status&quot;:&quot;none&quot;}
  ]
  
  
  
  for (var i = 0 ; i &lt; searchIDs.length ; i ++) {
  
      list.find(v =&gt; v.id !== searchIDs[i].id).status = &quot;none&quot;;
      list.find(v =&gt; v.id === searchIDs[i].id).status = &quot;active&quot;;
      Array.prototype.push.apply(list); 
  
  
  }
  
  
  
  console.log('Final List : '  + JSON.stringify(list)); 
  
  </code></pre>
  <p>But when I try with find function with for loops, it doesn't work for now. How could I solve it? Appreciate for reading my questions! thanks!</p>
  <p>Final result should be</p>
  <pre><code>
  [ 
      {&quot;id&quot;:&quot;9666&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;9667&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;9999&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;9668&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;9669&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6001&quot;, &quot;status&quot;:&quot;active&quot;},
      {&quot;id&quot;:&quot;6002&quot;, &quot;status&quot;:&quot;active&quot;},
      {&quot;id&quot;:&quot;6003&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6004&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6005&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6006&quot;, &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6007&quot;,  &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6008&quot;,  &quot;status&quot;:&quot;none&quot;},
      {&quot;id&quot;:&quot;6009&quot;,  &quot;status&quot;:&quot;none&quot;}
  ]
      
  </code></pre>