Let's say I have an object of this type and I want to sort the figsList array in that object based on createdAt property (latest first). How can I achieve this in JavaScript?
I want to perform this operation in my NodeJS backend.
{
id,
name,
figsList[
{
...
createdAt: DateTime
...
},
{
...
createdAt: DateTime
...
},
{
...
createdAt: DateTime
...
},
]
}