title: Looping through arrays within an array, if particular array has a specific word, grab that array
body: <p>I'm trying to create a search function where a search word is passed through (for example, "Food" or "Gym") and the function will loop through the arrays in the array, if that word is found within a nested array, it will be push that exact array into a filtered array. Which I can then display to the user. </p>
  
  <p>I've tried looking at different solutions but no luck. This is what I have so far.</p>
  
  <pre><code> // Filter list with search keyword
      function filter(keyword,list) {
        // placeholder for matches
        var filtered = [];
        // loop through list
        for (var i = 0; i &lt; list.length; i++) {
          var store = list[i];
  
          // loop through each individual array/store in list
          for (var y = 0; y &lt; store.length; y++) {
          // if match keyword
          if(store[y].match(keyword)){
            // push that store into filtered array
                  filtered.push(store);
            }
  
        else{
          alert('cannot find');
        };    
       };
    };    
  };     
  
  
  
  var list=[
      ["Mikes Gym",
      "21 Rosenberg Road",
      "Heidelberg",
      "Come get your ice",
      "5",
      ["onsequat. Phasellus diam .", "malesuada in. Integer eget molestie mi. Etiam a"],
      "9104-1059",
      "Gym"
      ],
        ["Mikes Cafe",
      "21 Rosenberg Road",
      "Heidelberg",
      "Come get your ice",
      "5",
      ["onsequat. Phasellus diam .", "malesuada in. Integer eget molestie mi. Etiam a"],
      "9104-1059",
       "Food"
      ],
        ["Mikes Hairdresser",
      "21 Rosenberg Road",
      "Heidelberg",
      "Come get your ice",
      "5",
      ["onsequat. Phasellus diam .", "malesuada in. Integer eget molestie mi. Etiam a"],
      "9104-1059",
       "Hairdresser"
      ],
        ["Mikes Nightclub",
      "21 Rosenberg Road",
      "Heidelberg",
      "Come get your ice",
      "5",
      ["onsequat. Phasellus diam .", "malesuada in. Integer eget molestie mi. Etiam a"],
      "9104-1059",
       "Club"
      ],
        ["Mikes Groceries",
      "21 Rosenberg Road",
      "Heidelberg",
      "Come get your ice",
      "5",
      ["onsequat. Phasellus diam .", "malesuada in. Integer eget molestie mi. Etiam a"],
      "9104-1059",
       "Shop"
      ]
    ];
  
  filter("Food",list)
  </code></pre>