0 points

javascript - How to sort an array of integers correctly - Stack Overflow


dashboard

Sun Oct 18 2020 22:43:43 GMT+0000 (UTC)

Posted by @lechodiman #javascript

var numArray = [140000, 104, 99];
numArray.sort(function(a, b) {
  return a - b;
});

console.log(numArray);
content_copy Copy

https://stackoverflow.com/questions/1063007/how-to-sort-an-array-of-integers-correctly