title: Multiple filters for arrays - Typescript
body: <p>I have 3 arrays. I want to return the elements in array1 distinct from array2 and array3.
  Example:</p>
  <pre><code>array1: [&quot;Peter&quot;, &quot;James&quot;, &quot;JohnDoe&quot;, &quot;Jackie&quot;]
  array2: [&quot;James&quot;, &quot;Dog&quot;]
  array3: [&quot;JohnDoe&quot;, &quot;Cat&quot;]
  
  Output: [&quot;Peter&quot;, &quot;Jackie&quot;]
  </code></pre>
  <p>Here is my code snippet of filtering array2 out of array1.</p>
  <pre><code>  const array1, array2, array3;
  
    const result = array1.filter(
      element=&gt; !array2.some(ele =&gt; element.id === ele.id)
    );
  // Output: [&quot;Peter&quot;, &quot;JohnDoe&quot;, &quot;Jackie&quot;]
  </code></pre>
  <p>I can think of creating another const for filtering array3, but is there a better/elegant way to attach the filters together(in one statement)? Thank you!</p>