title: Typescript filter array of object by another array of strings
body: <p>i stuck at my typescript filter function. </p>
  
  <p>I have an array of objects:</p>
  
  <pre><code>[
    {
      "id": 12345,
      "title": "Some title",
      "complexity": [
        {
          "slug": "1" // my search term
          "name": "easy"
        }, {
          "slug": "2" // my search term
          "name": "middle"
        },
  {...}
  </code></pre>
  
  <p>And i have a array of strings with the allowed complexity:</p>
  
  <pre><code>public allowedComplexityArray:Array&lt;string&gt; = ["1"];
  </code></pre>
  
  <p><strong>My Task:</strong> I only want to show objects with the allowed complexity of "1". </p>
  
  <p>But somehow my function dont work and i dont know why:</p>
  
  <pre><code>allowedMeals = meals.filter(meal =&gt; {
      return meal.complexity.every(complexityObj =&gt; that.allowedComplexityArray.indexOf(complexityObj.slug) &gt; -1)
  });
  </code></pre>