I'm having an array with certain numbers and an array with certain objects, looking like this:
var names = [
{ id: 1, name: 'Alex'},
{ id: 2, name: 'John'},
{ id: 3, name: 'Mary'}
];
var blocked_ids = [1, 2];
Now I would like to remove the objects with the blocked_ids from the names array. So the result would be this:
[
{ id: 3, name: 'Mary'}
]
As you can see the objects with id 1 and 2 are gone, because the array "blocked_ids" contained these numbers. If it where just two arrays, i could use _.difference(), but now I have to compare the blocked_ids with the id's inside the array's objects. Anyone knows how to do this?