I have am array of object i.e. JSON like this in my react state and before rendering it I want it to sort based on status property example- Actual Value
{
"list": [
{
"id": "aac",
"name": "James",
"status": "active"
},
{
"id": "gds",
"name": "Alice",
"status": "left"
},
{
"id": "cvs",
"name": "Kristy",
"status": "active"
},
{
"id": "cgt",
"name": "Samaira",
"status": "left"
},
]
}
Expecting Value after sorting based on status element
{
"list": [
{
"id": "aac",
"name": "James",
"status": "active"
},
{
"id": "cvs",
"name": "Kristy",
"status": "active"
},
{
"id": "gds",
"name": "Alice",
"status": "left"
},
{
"id": "cgt",
"name": "Samaira",
"status": "left"
},
]
}