Given the following array
var array = [
["key1", 10],
["key2", 3],
["key3", 40],
["key4", 20]
];
You can sort it sort it by number(second index)
array.sort(function(a, b) {
return a[1] - b[1];
})
6
array.sort((a,b) => a[1] - b[1]);...