I am basically trying to get all the data from one array of objects from another.
for example:

```
first_array = [{id: 1, name:'something'},{id: 2, name:'something 2'},{id: 3, name:'something 3'},{id: 4, name:'something 4'}]

```

now this array can have thousands of objects.

the next array is

```
 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}]

```

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.

```
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}]

```

So overall i am trying to implement a join with 3 tables but with vanialla js code.

I tried using the filter and the mapping over the result to third\_array but it is not working.

This is what i am trying the achieve the overall flow

```
first_array -> use id
 second_array -> first_array_ids be matched with second_array.matchingId
 third_array -> data returned from second_array use id, and then find all the elements inside third_array.

```

Hope i made my self clear.