title: Lodash How to filter out of a array
body: <p>I need to filter specific objects out of a array.
  i got multiple array's like this in a json file. </p>
  
  <pre><code> "functies":["zandbak", "voetbal", "petanque", "speeltoestellen", "basketbal"],
  </code></pre>
  
  <p>We need the possibility to filter on each element of the array for each object in the json file. </p>
  
  <p>Javascript code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>ready(function () {
  
      var App = {
          "init": function () {
              this.URLSPEEL = './data/speelterrein.json'; // Cache the url with random users in variable URLRANDOMUSERME
              this.loadDataSpeel(); // Load SPEEL Data
          },
          "loadDataSpeel": function () {
              //1. Create a XMLHttpRequest object (Send to and load data from a WebAPI)
              var xhr = typeof XMLHttpRequest != undefined
                  ? new XMLHttpRequest()
                  : new ActiveXObject('Microsoft.XMLHTTP');
              //2. Declare the type of the response
              xhr.responseType = 'json';
              //3. Listen to the changes in states within the connection
              xhr.onreadystatechange = function () {
                  switch (xhr.readyState) {
                      case 0:
                          console.log('UNSENT');
                          break;
                      case 1:
                          console.log('OPENED');
                          break;
                      case 2:
                          console.log('HEADERS RECEIVED');
                          console.log(this.getAllResponseHeaders());
                          break;
                      case 3:
                          console.log('LOADING');
                          break;
                      case 4:
                      default:
                          console.log('LOADED');
                          //If status equals 200 then everything is ok else nok
                          if (xhr.status == 200) {
                              console.log('OK');
                              //Get the received data --&gt; response
  
                              var data = (!xhr.responseType) ? JSON.parse(xhr.response) : xhr.response;
                              var speelterreinen = data.speelterreinen, n = speelterreinen.length, speelterrein = null;
                              var tempString_2 = "";
                            
  
                              for (var i = 0; i &lt; n; i++) {
                                  speelterrein = speelterreinen[i];
                                  console.log(speelterrein.length);
                                  tempString_2 += '&lt;div id="speelterrein_id" class="card blue-grey darken-1 z-depth-2"&gt;';
                                  tempString_2 += '&lt;div class="card-content white-text"&gt;';
                                  tempString_2 += '&lt;span class="card-title" &gt;' + speelterrein.naam;
                                  tempString_2 += '&lt;/span&gt;';
                                  tempString_2 += '&lt;h5&gt;Functies&lt;/h5&gt;&lt;p&gt;' + speelterrein.functies;
                                  tempString_2 += '&lt;div class="card-action"&gt;&lt;a target="_blank" class="waves-effect waves-light btn" href="' + speelterrein.plaats;
                                  tempString_2 += '"&gt;Locatie&lt;/a&gt;';
                                  tempString_2 += '&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;';
                                  console.log(speelterrein.functies);
  
                                  document.getElementById("speelterrein_id").innerHTML = tempString_2;
  
                              }
                          } else {
                              console.log(Error(xhr.status));
                          }
                          break;
                  }
  
              };
              //4. Open the connection or tunnel to the resource on the url
              xhr.open('GET', this.URLSPEEL, true);
              //5. Make the request to the specified resource
              xhr.send(null);
          }
      };
      App.init();
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>Example json file
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{"speelterreinen":[
    {
      "naam": "Sint-Baafskouterpark",
      "functies": ["avontuurlijk spelen", "zandbak", "speeltoestellen"],
      "coördinaten": "51.0568047,3.7551683",
      "gemeente": "Sint-Amandsberg"
    },
    {
      "naam": "Wasstraat speelterrein",
      "functies":["zandbak", "voetbal", "petanque", "speeltoestellen", "basketbal"],
      
      "coördinaten": "51.0553976,3.7442046",
      "gemeente": "Sint-Amandsberg"
    },
    {
      "naam": "Azaleastraat buurtpark",
      "functies":["zandbak", "petanque", "speeltoestellen", "basketbal"]
      "coördinaten": "51.0600225,3.7498565",
      "gemeente": "Sint-Amandsberg"
    },</code></pre>
  </div>
  </div>
  </p>