title: filtering an array of objects based on another array returning new array javascript
body: <p>I have an array of object, which we can call arrayOne and want to check with arrayTwo if it contain any string that match with ArrayOne, and it will return new array with matching array. What is the best approach I can do using ES6 ? </p>
  
  <p>Example : </p>
  
  <pre><code>ArrayOne =    [  
         {  
            "sessionId":1,
            "name":"session name 1",
            "types":[  
               "type1",
               "type 2"
            ],
            "tracks":[  
               "track1",
               "track 2"
            ]
         },
         {  
            "sessionId":2,
            "name":"session name 2",
            "types":[  
               "track 3",
               "type 2"
            ],
            "tracks":[  
               "track 3",
               "track 2"
            ]
         }
      ]
  
  
  arrayTwo = ["track 3"] // or it can be ["track&amp;3", "Type 2"] which it will return both array
  </code></pre>
  
  <p>return </p>
  
  <pre><code>newArray =  [ {  
        "sessionId":2,
        "name":"session name 2",
        "types":[  
           "track 3",
           "type 2"
        ],
        "tracks":[  
           "track 3",
           "track 2"
        ]
     }]
  </code></pre>
  
  <p>I tried the following : </p>
  
  <pre><code>arrayOne.filter((obj) =&gt; {
                  Object.keys(obj).forEach((key) =&gt; {
                      if (obj[key].toString().indexOf(arrayTwo) !== -1) {
                          this.setState({
                              newArray: [obj]
                          })
                      }
                  });
              });
  </code></pre>