{
"1": {
"id": 1,
"name": "Success"
},
"2": {
"id": 2,
"name": "Pending"
},
"3": {
"id": 3,
"name": "Failed"
},
"-1": {
"id": "-1",
"name": "All"
}}
This is My Object i need to sorting by id value.
I am tried as follow to sort this object but it's not work.
status.sort(function (a, b) {
return parseFloat(a.id) - parseFloat(b.id);});
how can i sort this object please give me solution.