title: jQuery Filter Data Array by Multiple Keys
body: <p>I have an object array that looks something like:</p>
  
  <pre><code>var arr = [{FilterBy: 1, Id: 10, Name: W},
                {FilterBy: 1, Id: 11, Name: X}, 
                {FilterBy: 2, Id: 12, Name: Y}, 
                {FilterBy: 3, Id: 13, Name: Z}];
  </code></pre>
  
  <p>I have a method where I filter the array and pass the parameter "oneId" (which is a single FilterBy id):</p>
  
  <pre><code> var filteredArr = arr.filter(function (x) { return x.FilterBy === oneId });
  </code></pre>
  
  <p>How can I expand this method to accept multiple IDs? I would like to pass an array of FilterByIds (i.e., 1, 2), in which case the result should be:</p>
  
  <pre><code> filteredArr = [{FilterBy: 1, Id: 10, Name: W},
                {FilterBy: 1, Id: 11, Name: X}, 
                {FilterBy: 2, Id: 12, Name: Y}]
  </code></pre>
  
  <p>Not sure if I can do a filter on multiple Ids like that (or don't know how to).</p>
  
  <p>Tried looking, but didn't yield anything.</p>
  
  <p>Thanks in advance!</p>