I have an array of objects that adhere to 2 different structures. Simplified example below:
1.
{
Foo: {
"Bar": {
"timestamp": "09/20/2022"
}
}
}
{
Baz: {
"Mok": {
"timestamp": "09/22/2022"
}
}
}
I'm trying to sort the array by each object's timestamp in descending order. In my .sort() function I've tried first checking to see which structure the objects being compared adhere to and then comparing the timestamps, but I'm not having any luck - the objects remain in the same position within the array. The timestamps are in the provided format. Any help is appreciated, thanks!