We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Allow to filter and map a collection in a single loop for better performance.
var myArray = [ { productId: 1, title: 'My Product 1', price: 10, quantity: 1 }, { productId: 2, title: 'My Product 2', price: 15.5, quantity: 4 }, { productId: 3, title: 'My Product 3', price: 7.25, quantity: 1 } ];
var titles = _.filterMap(myArray, function(obj) { if (obj.price >= 10) return obj.title; }); // titles === ['My Product 1', 'My Product 2']