How do i sort this object
here is my code
const player = {"Bong":"henry","rj":"ken","Robert":"dj","Brad":"jeff" }
Object.entries(player).sort(([k,v]) => {
if(k < v){
return -1
}
if(k > v){
return 1
}
return 0
})
my Expected output should be: {“Bong”:”dj”,”Brad”:”henry”,”rj”:”jeff”,”Robert”:”ken”}