title: Filtering Arrays with Multiple Values
body: <p>I'm filtering some arrays of objects by keyword using the JavaScript Array Filter. Initial, I had an array of objects:</p>
  
  <pre><code>  let works = [
      { title: ' work 1', medium: 'tax1' },
      { title: ' work 2', medium: 'tax2' },
      { title: ' work 3', medium: 'tax3' },
      { title: ' work 4', medium: 'tax2' },
      { title: ' work 5', medium: 'tax1' }
    ]
  </code></pre>
  
  <p>And could filter the array by the 'medium' in this manner:</p>
  
  <pre><code>    mediumFilter(taxonomy) {
          return works.filter(item =&gt; {
              return (
                item.medium.indexOf(taxonomy) &gt; -1
              );
          });
      },
  </code></pre>
  
  <p>When I pass the <em>taxonomy</em> variable to the <em>mediumFilter()</em>, in this case 'tax1' or so -- I get an array that includes the items containing that specific medium. </p>
  
  <p>This was initial -- now that my project is getting more complex, I find myself struggling. My new array includes a nested array, which are the values to match in the filtering.</p>
  
  <pre><code>  let works = [
      { title: ' work 1', medium: [ 'tax1', 'tax3' ] },
      { title: ' work 2', medium: [ 'tax1' ] },
      { title: ' work 3', medium: [ 'tax3' ] },
      { title: ' work 4', medium: [ 'tax2', 'tax1' ] },
      { title: ' work 5', medium: [ 'tax1' ] }
    ]
  </code></pre>
  
  <p>Notice how the medium is an array holding multiple strings.</p>
  
  <p>I'm looking for some assistance on how to approach this. I need my function to return items that match the variable im passing. As some works could have multiple mediums, I need to be able to filter by multiple values. If the array of mediums has multiple values, only one needs to match.</p>
  
  <p>Thanks!</p>
  
  <p><em>btw im using vue which is not relevant to the question but syntax of my examples might not be exact.</em></p>