I have an object that contains object and need to sort it by count
var obj={
"error1":{
"count":45,
"ids":['123','352']
},
"error2":{
"count":3,
"ids":['13','2']
},
"error3":{
"count":15,
"ids":['42','7']
}
}
I want to sort by count that the result would be
var obj={
"error2":{
"count":3,
"ids":['13','2']
},
"error3":{
"count":15,
"ids":['42','7']
},
"error1":{
"count":45,
"ids":['123','352']
}
}
How can I do that