-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Open
Labels
Description
Currently having array of objects, to delete one of them I need to write:
var collection = [{id: 1}, {id: 3}];
var objectToRemove = _.findWhere(collection, function (obj) { return obj.id === 3 });
var objectIndex = collection.indexOf(objectToRemove);
collection.splice(objectIndex, 1);It would be nice to have in underscore something like:
_.deleteWhere(collection, {id: 2})If you find this useful I can try to implement it and send a PR.