2
I’m wondering how I can organize an array of objects in Javascript through the creation date of the item that comes as a value in the object, follow an example:
[
{
...valores,
requestedCase: {
...valores,
creationDate: "2020-02-04T17:18:02"
}
},
{
...valores,
requestedCase: {
...valores,
creationDate: "2020-01-31T13:49:22"
}
}
]
When I receive this data from the API, I would like to create a new array with the items sorted decreasing through the creationDate
.
I did some research and I couldn’t find anything that would solve my problem, can someone please help me!
this other tbm is almost the same thing: https://answall.com/questions/434909/selectr-itens-e-sorts
– Ricardo Pontual
This answers your question? How to sort an array of objects with array.Sort()
– gmsantos