180
rated 0 times
[
187]
[
7]
/ answers: 1 / hits: 63375
/ 11 Years ago, tue, july 23, 2013, 12:00:00
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 following Javascript array:
[{ name : sEcho, value : 1},{ name : iColumns, value : 12}, ... ]
And I need to transform it into the following object:
{
sEcho: 1,
iColumns: 12,
...
}
I'm using underscore.js for a reason so it must be a one liner.
More From » underscore.js