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
This should do it:
_.reduce(array, function(o, v){ o[v.name] = v.value; return o; }, {});
As a one-liner (you are kidding me, right?):
_.reduce(array,function(a,b){a[b.name]=b.value;return a},{});