title: Test if array has value
body: <p>I have a array that I fetched from git HUB api,</p>
  <pre><code>[{
   id: 362784382,
   imageURL: &quot;https://raw.githubusercontent.com/CRISTIAN-MULLER/BookShelf-Backend/main/Tela.png&quot;,
   name: &quot;BookShelf Backend&quot; ,
   ownerName: &quot;CRISTIAN-MULLER&quot;,
   topics: [&quot;javascript&quot;,&quot;reactjs&quot;]
  },
  {
    id: 362784383,
    imageURL: &quot;https://raw.githubusercontent.com/CRISTIAN-MULLER/BookShelf- 
    Backend/main/Tela.png&quot;,
    name: &quot;BookShelf&quot; ,
    ownerName: &quot;CRISTIAN-MULLER&quot;,
    topics: [&quot;other tag&quot;,&quot;react&quot;]
  
  }
  
  ]
  </code></pre>
  <p>This data has tags with languages that I used in My projects,</p>
  <p>In another part of my code i have a function that iterates trough this array and returns a array of tags with unique names.</p>
  <pre><code>const topicsWithoutDuplicates = [...new Set(topics.flat())].map((elem) =&gt; ({
      id: elem,
      title: elem,
    })); 
  </code></pre>
  <p>I render for each element a button im My portfolio page, and I need to when i click a button , iterate all data and return only the projects that has the topic matching the button ID,</p>
  <p>I'm trying to construct a function that do this, but I'm stuck, &quot;selected&quot; has an array of strings with the buttons pressed [&quot;javascript&quot;, &quot;react&quot;, ....],</p>
  <p>I know that includes Method receives only strings as arguments and thats way this is not working, so I need to get the &quot;selected&quot; array and for each, item iterate over the received data from github and return only the elements that has in topics the same name that I have in selected array.</p>
  <p>so basicaly i need to iterate an array over another array comparing each element.</p>
  <pre><code>  const filteredData = userData.filter((item) =&gt;
        item.topics.map((topic) =&gt;
          topic.includes(selected)
        )
      );
  </code></pre>
  <p>How can I do that?, I'm not thinking anymore.</p>