Skip to content

Instantly share code, notes, and snippets.

@tonylea
Created April 10, 2016 17:21
Show Gist options
  • Save tonylea/2756b19f343c5df747126dbf55984010 to your computer and use it in GitHub Desktop.
Save tonylea/2756b19f343c5df747126dbf55984010 to your computer and use it in GitHub Desktop.
Sort array of numbers correctly
function sortNumber(a,b) {
return a - b;
}
var numArray = [140000, 104, 99];
numArray.sort(sortNumber);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment