Node.js lodash filter() filter by object attribute value
filter()
var _ = require('lodash'); var objects = [{a: true, b: false}, {a: false}, {b: true}, {a: true, c: true}]; var results = _.filter(objects, 'a'); console.log(results);// w w w . ja v a 2s. co m