So I working on a discord bot that has a rank system. I have got to the point where I have an object that looks like this:
let ranks = {
"Joe": 1,
"Mary": 6,
"Johnson": 4
}
so I need to sort these in order of level so it looks like this:
let ranks = {
"Mary": 6,
"Johnson": 4,
"Joe": 1
}
I have no idea how to do this. I have tried putting the values into lists and using names.sort() but that does not work. Any help would be appriciated.