javascript sort object js
grossaryList = {
'bread': 1,
'apple': 6,
'milk': 1,
'orange': 3,
'broccoli': 2
}
return Object
.entries(grossaryList)
.sort((a,b) => b[1]-a[1])
//=> [['apple', 6],['orange', 3],['broccoli', 2],['bread',1],['milk', 1]]