Variation on Sza’s answer, using the “array of pairs” signature of _.object
:
_.object(_.map(data, function(x){return [x.name, x.value]}))
Variation on Sza’s answer, using the “array of pairs” signature of _.object
:
_.object(_.map(data, function(x){return [x.name, x.value]}))