title: How to know if values includes in array and if exist push to array?
body: <p>I need to push in array data if exist in array?
  Example code:</p>
  <pre><code>  filterMealType(type){ 
          this.filteredRecipe.map(
            obj =&gt; { 
              if(obj.mealTypes.includes(type)){
                this.filterRecipeByMealType.push(obj) 
              }else {
                this.filterRecipeByMealType = []
              }
            }
          )
          console.log('current array ', this.filterRecipeByMealType)
        }
  </code></pre>
  <p>type as parameter is only number, 0 or 1 or 2 or 3.
  filteredRecipe is array:</p>
  <pre><code>[
     {
        &quot;name&quot;:&quot;Obroki&quot;,
        &quot;description&quot;:&quot;&quot;,
        &quot;difficulty&quot;:4,
        &quot;preparationTime&quot;:1920,
        &quot;ingredients&quot;:[
           &quot;dsad&quot;,
           &quot;dasdas&quot;
        ],
        &quot;instructions&quot;:[
           &quot;sad&quot;,
           &quot;dsa&quot;
        ],
        &quot;pictureUrl&quot;:&quot;https://www.url.com/images/cb51adad61a04936b831378865ad8bf6.jpg&quot;,
        &quot;recepieType&quot;:&quot;&quot;,
        &quot;mealTypes&quot;:[
           0,
           2
        ],
        &quot;id&quot;:281
     },
     {
        &quot;name&quot;:&quot;Testen&quot;,
        &quot;description&quot;:&quot;&quot;,
        &quot;difficulty&quot;:3,
        &quot;preparationTime&quot;:240,
        &quot;ingredients&quot;:[
           &quot;sestavino&quot;,
           &quot;test&quot;
        ],
        &quot;instructions&quot;:[
           &quot;inst&quot;
        ],
        &quot;pictureUrl&quot;:&quot;https://www.url.com/images/aca27231f9af4ed0af5e1ec4af09861e.jpg&quot;,
        &quot;recepieType&quot;:&quot;&quot;,
        &quot;mealTypes&quot;:[
           0,
           2
        ],
        &quot;id&quot;:282
     },
     {
        &quot;name&quot;:&quot;Mleko&quot;,
        &quot;description&quot;:&quot;&quot;,
        &quot;difficulty&quot;:2,
        &quot;preparationTime&quot;:2580,
        &quot;ingredients&quot;:[
           &quot;ddd&quot;
        ],
        &quot;instructions&quot;:[
           &quot;das&quot;,
           &quot;dasd&quot;
        ],
        &quot;pictureUrl&quot;:&quot;https://www.url.com/images/1fd0bd88175a4680ae9430579f1b781c.jpg&quot;,
        &quot;recepieType&quot;:&quot;&quot;,
        &quot;mealTypes&quot;:[
           1
        ],
        &quot;id&quot;:283
     },
     {
        &quot;name&quot;:&quot;test&quot;,
        &quot;description&quot;:&quot;&quot;,
        &quot;difficulty&quot;:4,
        &quot;preparationTime&quot;:240,
        &quot;ingredients&quot;:[
           &quot;jajca&quot;,
           &quot;meso&quot;
        ],
        &quot;instructions&quot;:[
           &quot;rf&quot;
        ],
        &quot;pictureUrl&quot;:&quot;https://www.url.com/images/0fafcd552354468bbca3a78cb9796004.jpg&quot;,
        &quot;recepieType&quot;:&quot;&quot;,
        &quot;mealTypes&quot;:[
           0,
           2
        ],
        &quot;id&quot;:211
     }
  ]
  </code></pre>
  <p>I if obj.mealTypes includes any of number i need to push to array.
  Right now no work good. Now i only push one item...no work good.
  If you need i can share to stackblitz</p>