Skip to content

Instantly share code, notes, and snippets.

@thirdj
Created April 12, 2013 00:31
Show Gist options
  • Select an option

  • Save thirdj/5368321 to your computer and use it in GitHub Desktop.

Select an option

Save thirdj/5368321 to your computer and use it in GitHub Desktop.
Array number sorting
var points = [40,100,1,5,25,10];
points.sort(function(a,b){return a-b});
console.log(points); // 1,5,10,25,40,100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment