|
|
|
|
|
by oftenwrong
4694 days ago
|
|
You could also do it with chain, which could make the first example a bit simpler to read and write. It is something like: var newArray = _.chain(array).filter(function(item) {
return item % 2;
}).map(function(item) {
return item + 1;
}).value();
I often use CoffeeScript + Underscore |
|