I have an object like:
json_result = {X: 0.42498, A: 0.34891, B: 0.38408, C: 0.22523}
I want to sort the above in descending order of values, i.e.,
json_result = {X: 0.42498, B: 0.38408, A: 0.34891, C: 0.22523}
I am thinking something like:
for ( key in json_result)
{
for ( value1 in json_result[key])
{
for (value2 in json_result[key])
{
}
}
}
Is there any other way around?