Skip to content

Instantly share code, notes, and snippets.

@AlexPashley
Created September 8, 2013 10:33
Show Gist options
  • Save AlexPashley/6483687 to your computer and use it in GitHub Desktop.
Save AlexPashley/6483687 to your computer and use it in GitHub Desktop.
Order an array of objects with JavaScript Courtesy of david walsh: http://davidwalsh.name/array-sort
// sort scores in order
scores.sort( function(obj1, obj2) {
return obj1.attempts - obj2.attempts;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment