I am trying to order an array. I tried following code:
var groupUserCounter=[];
groupUserCounter["g1"]=1;
groupUserCounter["g2"]=2;
groupUserCounter["g3"]=3;
console.log(groupUserCounter.sort(function(a, b){return b-a}));
It returned:
Array [ ]
How can I do descending order?
groupUserCounter.push()instead of assigning the properties.