Node.js lodash map() map object attribute

Description

Node.js lodash map() map object attribute


var _ = require('lodash');
var numbers = {a: 1, b: 2, c: 3};

var result = _.map(numbers, function(value, key) {
  console.log('key: ' + key);
  return value * 2;
});/* w w  w.j  av  a2 s. c o m*/

console.log('Final Result:');
console.log(result);



PreviousNext

Related