I'am trying to solve an issue that requires the sort of an array of objects containing information. For example, transform this:
[
{
name: 'test1',
date: '2019-02-18T08:33:01.000Z',
},
{
name: 'test2',
date: '2019-02-19T08:33:01.000Z',
},
{
name: 'test3',
date: '2019-02-19T08:33:01.000Z',
},
]
To this:
{
'2019-02-18':{
name: 'test1'
},
'2019-02-19':[
{
name: 'test2',
},
{
name: 'test3',
}
]
}
How can i achieve this?