I'm trying to remove objects from an array based on their keys by passing in an array of keys.
For example, I have an array of objects called "clients":
[
{ id: 1, name: Tim },
{ id: 2, name: Bob },
{ id: 3, name: Joe },
]
Then I have another array with the keys called "ids":
[1,3]
After I filter it, I should be left with just:
[
{ id: 2, name: Bob },
]
So far I've tried this, but it returns everything:
filteredClients = clients.filter(n.id => !ids.includes(n.id)