4 ms·
It is not so bad in JavaScript anymore. With Lodash: _(myList) .filter(x => x.name == 'Person') .filter(x => x.age > 18) .value()
by megaman821 12y ago
It is not so bad in JavaScript anymore. With Lodash:
_(myList)
.filter(x => x.name == 'Person')
.filter(x => x.age > 18)
.value()
Used like this Lodash is lazy, so the first value of myList will run through all the filters before the next item gets processed.