I'm unable to sort an array containing int. Here's my code for the sort :
var asr = [];
function sortNumber(a, b) {
return b - a;
}
asr.sort(sortNumber);
The function sort
doesn't do anything, here is a sample of my array when I made a console.log(asr)
on chrome :
by: 3
de: 2
ds: 14
sr: 2
vi: 1proto: Array(0)