Node.js lodash filter() filter by object attribute value

Description

Node.js lodash filter() filter by object attribute value


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



PreviousNext

Related