my object:
0: {
id: 20050,
name: "something",
date: "2021-01-28 16:46:02",
},
1: {
id: 20054,
name: "other something",
date: "2021-01-28 12:25:57",
},
2: {
id: 20059,
name: "again something",
date: "2021-02-15 07:01:34",
},
I map it like this:
Object.keys(myObj).forEach(function(item, index) {
myObj[item].id // returns myObj id value
myObj[item].name // returns myObj name value
});
I need to sort by the most recent or oldest date, and I have no idea how to use "myObj.sort" with the type of object I have here