title: How to filter array of objects based on other array of objects?
body: <p>I have 2 arrays of objects:</p>
  <pre><code>Array1
  Array2
  </code></pre>
  <p>I am trying to filter Array1 by getting only items which productIds are the same as array2 item productIds</p>
  <pre><code>const filteredArray = Array1.filter(item =&gt;
    Array2.includes(item.productId),
  )
  </code></pre>
  <p>The above solution always returns empty array. What is wrong and how can be it fixed?</p>