I\'ve been going through the underscore docs but I can\'t seem to find a method (or nested method call) to do the following transformation:
Let\'s say I have the followi
var names = _.pluck(data, 'name');
var values = _.pluck(data, 'value');
var result = _.object(_.zip(names, values));
console.log(result);
var arr = [{ "name" : "sEcho", "value" : 1},{ "name" : "iColumns", "value" : 12}]
ES6
_.mapObject( _.indexBy(arr, 'name'), (v) => v.value )
ES5
_.mapObject( _.indexBy(arr, 'name'), function (v) { return v.value; } )
This iterates twice though