sort an integer in descending order js code example
Example: javascript sort numbers descending
var numArray = [140000, 32, 12, 63323, 104, 99];
numArray.sort(function(a, b) {
return b - a;
});
// Array(6) [ 140000, 63323, 104, 99, 32, 12 ]
var numArray = [140000, 32, 12, 63323, 104, 99];
numArray.sort(function(a, b) {
return b - a;
});
// Array(6) [ 140000, 63323, 104, 99, 32, 12 ]