title: Passing an array to JavaScript filter function
body: <p>Let's say I have an array of objects like this:</p>
  
  <pre><code>someObj: [
      {
          name: "Obj1",
          type: "a"
      },
      {
          name: "Obj2",
          type: "b"
      },
      {
          name: "Obj3",
          type: "c"
      }
  ]       
  </code></pre>
  
  <p>Now I have a function that should return an array of objects from the <code>someObj</code> array if the parameters passed have the same <code>type</code> property. The thing is the parameter passed is an array and I'm not sure how to make that comparison.</p>
  
  <pre><code>function filter(types) {
    var filtered = someObj.filter(function(item) {
  
      return item.type == ???
  
    });       
  
    return filtered;  
  }
  
  filter(["a", "c"]);
  </code></pre>
  
  <p>How do I compare each item in the array parameter that's passed to item.type so that if they're equal, then the filter function would return to me an array like so:</p>
  
  <pre><code>[
   {
      name: "Obj1",
      type: "a"
   },
   {
      name: "Obj3",
      type: "c"
   }
  ]
  </code></pre>