title: Filter through nested arrays and return objects with matching categories
body: <p>I'm using react+ nextJS and grabbing static objects, &quot;posts&quot;. The goal is to create a &quot;related posts&quot; component on each post which grabs three posts that contain at least one of the categories. Here's what it looks like when I run a map on AllPosts (I trimmed it down so it's easier to read):</p>
  <pre><code>const allPosts = getAllPosts(['title', 'categories'])
  </code></pre>
  <pre><code>[{
    title: 'Black History Month: A History in Black Cinematography',
    categories: [ 'education' ]
  }
  {
    title: 'New Kid on the Block',
    categories: [ 'announcements', 'new hires' ]
  }
  {
    title: 'Olivia Boldt: Bol(d)ting Into the Bakery',
    categories: [ 'announcements', 'new hires' ]
  }
  {
    title: 'PDF Presets in Adobe Illustrator. Which one should you use?',
    categories: [ 'Research', 'education' ]
  }
  {
    title: 'Pixel Bakery does XYZ',
    categories: [ 'press &amp; media', 'announcements' ]
  }
  {
    title: 'Recipe for Success: Mix Adaptability and Confidence (together, in a medium sized bowl)',
    categories: [ 'editorial', 'second cat', 'third cat' ]
  }
  {
    title: 'Samee Callahan: A Winding Path to Excitement',
    categories: [ 'announcements', 'new hire' ]
  }
  {
    title: 'Sophia Stueven’s Favorite Way to Breathe',
    categories: [ 'announcements', 'new hires' ]
  }]
  </code></pre>
  <p>So far, I can get it to match posts that have the same [0] category, but I can't wrap my brain around how to compare all of them:</p>
  <pre><code>const allPosts = getAllPosts(['title', 'categories'])
  const SearchCat = post.categories[0]
  const matchingPosts = allPosts.filter((item) =&gt; item.categories[0] === SearchCat)
  console.log(matchingPosts)
  </code></pre>
  <p>yields:</p>
  <pre><code>  [{
      title: 'An Introduction to our Technology Stack',
      categories: [ 'announcements', 'new hire' ]
    },
    {
      title: 'New Kid on the Block',
      categories: [ 'announcements', 'new hires' ]
    },
    {
      title: 'Olivia Boldt: Bol(d)ting Into the Bakery',
      categories: [ 'announcements', 'new hires' ]
    },
    {
      title: 'Samee Callahan: A Winding Path to Excitement',
      categories: [ 'announcements', 'new hire' ]
    },
    {
      title: 'Sophia Stueven’s Favorite Way to Breathe',
      categories: [ 'announcements', 'new hires' ]
    }]
  </code></pre>
  <p>How do I go about adding another filter layer that doesn't care about the position the category match is in and only require one of them to match?</p>