Node.js lodash pluck()

Description

Node.js lodash pluck()


var _ = require('lodash');
var objects = [{one: 'hello', two: 'foo'}, {one: 'world', two: 'bar'}];

var resultsOne = _.pluck(objects, 'one');
var resultsTwo = _.pluck(objects, 'two');

console.log('resultsOne:');
console.log(resultsOne);/*from w  w  w  .  j av  a 2  s .  c o  m*/
console.log('resultsTwo:');
console.log(resultsTwo);



PreviousNext

Related