I am trying to convert the following dataset:
var foo = {
"2011":
[{ "date": "2011-08-01T00:00:00", "y": "100" },
{ "date": "2011-08-05T00:00:00", "y": "400" },
{ "date": "2011-09-01T00:00:00", "y": "900" }
],
"2012":
[{ "date": "2012-07-22T00:00:00", "y": "200" },
{ "date": "2012-09-22T00:00:00", "y": "430" },
{ "date": "2012-10-26T00:00:00", "y": "100" }
]
}
into something like this:
var foo1 = {
"2011":
[{ "y": "1400" }],
"2012":
[{ "y": "730" }]
}
What would be the best way to do this using UnderscoreJS? Thanks in advance!