title: .filter() array using another array's elements
body: <p>I have an array of people's names along with their knowledge of languages. What I want to do is pass a filter onto the language column and filter out any results that don't match.</p>
  
  <p>This is the sample array </p>
  
  <pre><code>   var myArray = [["Steppen", "Spanish Polish"],
                    ["Wolf", "Spanish Polish Tagalog"],
                    ["Amanda", "Spanish"],
                    ["Ada", "Polish"],
                    ["Rhonda", "Spanish Tagalog"]];
  </code></pre>
  
  <p>As far as passing in filters, it could be either one language or many. Even if one language from a filter matches - the result should be returned. So for example, a filter of "Tagalog" should return - Wolf and Rhonda. A filter of "Spanish Polish" should return everyone - there's either a match in Spanish or Polish.</p>
  
  <p>I wrote the filter function but for some reason it's getting stuck, when I pass the filter "Tagalog" it only iterates to the second cell in the array (Spanish Polish Tagalog) and repeats itself multiple times instead of going forward.</p>
  
  <p>What am I doing wrong, should I be iterating differently?</p>
  
  <pre><code> var userPassedFilter = new Array();
   userPassedFilter[0] = "Tagalog";
  
   newArray = consolidatedFilters(myArray, userPassedFilter);
   console.log(newArray);
  
   function consolidatedFilters(passedArray, passedFilter)
   {
   var filteredArray = passedArray.filter(    
      function(el)
      {
          for (var i = 0; i &lt; passedArray.length; i++)
           {
              console.log("i is " + i);
               for (var j in passedFilter)
              {
                  console.log("Passed Filter j " + passedFilter[j]);
                  console.log("Passed Array  i " + passedArray[i][1]);        
                  console.log("String Search " + passedArray[i][1].search(passedFilter[j]));
  
                  if (passedArray[i][1].search(passedFilter[j]) != -1)
                  {
                      return true;
                  }
              }           
          }
           return false;
      }
   );     
   return filteredArray;
   }
  </code></pre>