title: Compare three array of objects using Id from one array to another
body: <p>I am basically trying to get all the data from one array of objects from another.
  for example:</p>
  <pre><code>first_array = [{id: 1, name:'something'},{id: 2, name:'something 2'},{id: 3, name:'something 3'},{id: 4, name:'something 4'}]
  </code></pre>
  <p>now this array can have thousands of objects.</p>
  <p>the next array is</p>
  <pre><code> second_array = [{idx: 40, name:'something',matchingId:1 },{idx: 30, name:'something 2'},{idx: 60, name:'something 3',matchingId:1 },{idx: 20, name:'something 4',matchingId:2},{idx: 25, name:'something 4',matchingId:2},{idx: 26, name:'something 4',matchingId:3}]
  </code></pre>
  <p>now using matchingId from this second_array i want to get elements from first_array and then return all the objects.Now using the newly created array i want to find all the elements inside the third_array with the same id.</p>
  <pre><code>third_array = [{id: 1, name:'something',matchingIdFromSecond:40 },{id: 2, name:'something 2'},{id: 3, name:'something 3',matchingIdFromSecond:40 },{id: 3, name:'something 4',matchingIdFromSecond:30},{id: 4, name:'something 4',matchingIdFromSecond:2},{id: 5, name:'something 4',matchingIdFromSecond:26}]
  </code></pre>
  <p>So overall i am trying to implement a join with 3 tables but with vanialla js code.</p>
  <p>I tried using the filter and the mapping over the result to third_array but it is not working.</p>
  <p>This is what i am trying the achieve the overall flow</p>
  <pre><code>first_array -&gt; use id
   second_array -&gt; first_array_ids be matched with second_array.matchingId
   third_array -&gt; data returned from second_array use id, and then find all the elements inside third_array.
  </code></pre>
  <p>Hope i made my self clear.</p>