Reputation: 2354
I'm trying to learn chaining in lodash/underscore..
I found a nice chaining code here..
var xs = [{a: 1, b: 2}, {b: 3, c: 4, d: 5}];
console.log(JSON.stringify(
_(xs).map(_.keys).flatten().unique().value()));
Now, I would like to remove a value 'b' from the resultant array.
Without chaining I could have done the following..
_.pull(list, 'b'); // ['a', 'c', 'd']
What would I do if I wanted to continue the chain or is chaining only possible in specific conditions..
Thanks
Upvotes: 1
Views: 84