Suppose I have a series of arrays like this:
[{title: 'foo', data: 'something here'},
{title: 'foo', data: 'something else here'},
{title: 'bar', data: 'something else again'}
]
What would be nice is if I could transform them into a series of objects grouped by title as the key.
So the transformation would look something like this:
{
'foo': {data: ['something else', 'something else here']}
'bar': {data: ['something else again']}
}
How would I go about that in a somewhat elegant manner?