10
rated 0 times
[
13]
[
3]
/ answers: 1 / hits: 19195
/ 7 Years ago, wed, january 3, 2018, 12:00:00
I have an array of objects like:
var a = [
{id: 1, name: 'A'},
{id: 2, name: 'B'},
{id: 3, name: 'C'},
{id: 4, name: 'D'}
];
And Ids array which i want to remove from array a :
var removeItem = [1,2];
I want to remove objects from array a
by matching its ids, which removeItem array
contains. How can i implement with lodash.
I Checked lodash's _.remove method, but this need a specific condition to remove an item from array. But i have list of ids which i want to remove.
More From » arrays