title: Javascript Array of Object: filter by multple AND conditions
body: <p><strong>My mocked data:</strong></p>
  <pre><code>[
    {
      &quot;id&quot;: 1,
      &quot;first_name&quot;: &quot;Suzy&quot;,
      &quot;last_name&quot;: &quot;Pinnell&quot;,
      &quot;email&quot;: &quot;spinnell0@utexas.edu&quot;,
      &quot;gender&quot;: &quot;Agender&quot;,
      &quot;image&quot;: &quot;http://dummyimage.com/410x239.png/5fa2dd/ffffff&quot;,
      &quot;department&quot;: &quot;Marketing&quot;,
      &quot;job_title&quot;: &quot;Quality Control Specialist&quot;,
      &quot;skill&quot;: &quot;Residential Homes&quot;
     },
    {
      &quot;id&quot;: 2,
      &quot;first_name&quot;: &quot;Enriqueta&quot;,
      &quot;last_name&quot;: &quot;Folbig&quot;,
      &quot;email&quot;: &quot;efolbig1@google.com.br&quot;,
      &quot;gender&quot;: &quot;Male&quot;,
      &quot;image&quot;: &quot;http://dummyimage.com/247x244.png/5fa2dd/ffffff&quot;,
      &quot;department&quot;: &quot;Sales&quot;,
      &quot;job_title&quot;: &quot;Environmental Specialist&quot;,
      &quot;skill&quot;: &quot;MMC&quot;
    },
    {
      &quot;id&quot;: 3,
      &quot;first_name&quot;: &quot;Simmonds&quot;,
      &quot;last_name&quot;: &quot;Acomb&quot;,
      &quot;email&quot;: &quot;sacomb2@amazon.co.uk&quot;,
      &quot;gender&quot;: &quot;Polygender&quot;,
      &quot;image&quot;: &quot;http://dummyimage.com/315x256.png/dddddd/000000&quot;,
      &quot;department&quot;: &quot;Human Resources&quot;,
      &quot;job_title&quot;: &quot;Accountant&quot;,
      &quot;skill&quot;: &quot;Xilinx&quot;
    },
    {
      &quot;id&quot;: 4,
      &quot;first_name&quot;: &quot;Bernita&quot;,
      &quot;last_name&quot;: &quot;Hartman&quot;,
      &quot;email&quot;: &quot;bhartman3@whitehouse.gov&quot;,
      &quot;gender&quot;: &quot;Female&quot;,
      &quot;image&quot;: &quot;http://dummyimage.com/305x275.png/dddddd/000000&quot;,
      &quot;department&quot;: &quot;Support&quot;,
      &quot;job_title&quot;: &quot;Account ExecutiveII&quot;,
      &quot;skill&quot;: &quot;Airframe&quot;
    }
  ]
  </code></pre>
  <p>I found a similar question here:
  <a href="https://stackoverflow.com/questions/31831651/javascript-filter-array-multiple-conditions/31831801#31831801">javascript filter array multiple conditions</a></p>
  <p><strong>To define what to filter they pass an object:</strong></p>
  <pre><code>var filter = {
    gender: 'male',
    department: 'Sales'
  };
  </code></pre>
  <p>This works. It shows every object containing both keys.</p>
  <p>+<em>I tried to modify it, so I could use an array:</em>*</p>
  <pre><code>var filter = {
    gender: ['Male'],
    department: ['Sales', 'Marketing']
  };
  </code></pre>
  <p>My goal is to filter the data by the given values in the array. Only items should appear, which contain all males in sales and marketing.</p>
  <p>I tried includes (inside filter and a for in loop), but it shows only the results of the first array, the second one is ignored. I am not sure how to achieve a AND condition inside the arrays for all of them.</p>
  <p>Thank you.</p>