Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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 ]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #sort #numbers #descending
ADD COMMENT
Topic
Name
9+4 =