title: Filter array of objects based on another array in javascript
body: <p>Given an array of objects :</p>
  <pre><code>people = [
      {id: &quot;1&quot;, name: &quot;abc&quot;, gender: &quot;m&quot;, age:&quot;15&quot; },
      {id: &quot;2&quot;, name: &quot;a&quot;, gender: &quot;m&quot;, age:&quot;25&quot; },
      {id: &quot;3&quot;, name: &quot;efg&quot;, gender: &quot;f&quot;, age:&quot;5&quot; },
      {id: &quot;4&quot;, name: &quot;hjk&quot;, gender: &quot;m&quot;, age:&quot;35&quot; },
      {id: &quot;5&quot;, name: &quot;ikly&quot;, gender: &quot;m&quot;, age:&quot;41&quot; },
      {id: &quot;6&quot;, name: &quot;ert&quot;, gender: &quot;f&quot;, age:&quot; 30&quot; },
      {id: &quot;7&quot;, name: &quot;qwe&quot;, gender: &quot;f&quot;, age:&quot; 31&quot; },
      {id: &quot;8&quot;, name: &quot;bdd&quot;, gender: &quot;m&quot;, age:&quot; 78&quot; },
  ]
  </code></pre>
  <p>And an array of wanted ids:</p>
  <pre><code>id_filter = [1,4,5,8]
  </code></pre>
  <p>How to filter array <code>people</code> to return the target ids defined in <code>id_filter</code> and of <code>gender=m</code> ?</p>