If I have a JavaScript object like this:
list = {
John: {
DOB: '2017-02-01'
},
Rob: {
DOB: '2016-07-09'
},
}
How do I go about sorting this object into a list of objects sorted by their DOB. I have lodash installed, so using that is an option.
I would like the result to be something mappable, ie an array such as:
sorted_keys = ['Rob','John']
or
sorted_array = [
{
Rob: {
DOB: '2016-07-09'
}
},
{
John: {
DOB: '2017-02-01'
}
},
]