[ACCEPTED]-Remove key from object/value using Lodash-lodash
Accepted answer
You can use remove()
inside the forEach()
to achieve the 2 result you want...
_(z).forEach(function (n) {
_.remove(b, { 'name': n });
});
The code can be further 1 simplified by removing z
and forEach()
...
var a = _.filter(characters, { 'blocked': 'a' });
var b = _(characters)
.difference(a)
.reject(function (x) {
return _.where(a, { 'name': x.name }).length;
})
.value();
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.