title: Match any element of an array against another array
body: <p>Using the following function, I am searching an array for the existence of a value;</p>
  
  <pre><code>var checkboxValues = ['large-car', 'small-car', 'automatic'];
  var carType = ["large-car"];
  
  function searchArray(arguments)
  {
    var o = {};
    for(var i=0;i&lt;arguments.length;i++)
    {
      o[arguments[i]]=null;
    }
    return o;
  }
  
  if (carType in searchArray(checkboxValues) )
      //do something...
  </code></pre>
  
  <p>This condition works well when <code>carType</code> (which is an array itself) contains only one value but when <code>carType</code> contains multiple values such as,</p>
  
  <pre><code>var carType = ["large-car", "4WD"];
  </code></pre>
  
  <p>...then the function will return false.</p>
  
  <p>To give some background, what I am trying to do is show or hide map markers (via Google Maps) based on certain conditions,</p>
  
  <ul>
  <li>Automatic</li>
  <li>Manual</li>
  <li>Small Car </li>
  <li>Large Car</li>
  <li>4WD</li>
  </ul>
  
  <p>Each of these values is represented as a checkbox. If "Automatic" and "Small Car" are selected, then only shown map markers who contain both those values. </p>
  
  <p>If "Automatic", "Small Car" and "Large Car" are selected then only show values which match those selections.</p>
  
  <p>This works if the <code>carType</code> array contains only a single value but as an individual vehicle may have more than one type as shown above, this is where the function fails.</p>
  
  <p>What's the best way to write the function to allow for comparing multiple values in one array against that of another?</p>