title: How do I filter array of objects based on a list of possible ID properties?
body: <p>I'm trying to filter <code>arr2</code>. If the element doesn't have an ID listed in <code>arr</code>, then I want it to be removed. How could I make this happen in javascript?</p>
  <pre><code>var arr= [&quot;a&quot;, &quot;b&quot;, &quot;d&quot;]
  var arr2=[{id:&quot;a&quot;, value:1},{id:&quot;b&quot;, value:2}, {id:&quot;c&quot;, value:3}]
  </code></pre>
  <pre><code>result:
  [{id:&quot;a&quot;, value:1},{id:&quot;b&quot;, value:2}]
  </code></pre>
  <p>Thanks in advance :)</p>