What is the best way to sort this:
{
abc: {
string: 'lorem',
date: 2
},
enc: {
string: 'ipsum',
date: 1
}
}
into this:
[{
id: 'enc',
string: 'ipsum',
date: 1
},
{
id: 'abc',
string: 'lorem',
date: 2
}]
I need an array sorted by the date (Number) with a flat object.