Array1 = [{id: "1"}.{id: 2},{id: "3"}]
Array2 = [{id: "1"}.{id: 2},{id: "3"}, {id: "4"}, {id: "5"}]
I need to get the objects from Array 2 that no are in array 1;
The result should be:
ArrayFiltered = [{id: "4"}, {id: "5"}]
So how can I do that with typescript?
Array2.filter(elem2 => !Array1.some(elem1 => elem1.id === elem2.id)