Skip to content

Instantly share code, notes, and snippets.

@taterbase
Created May 7, 2012 22:17
Show Gist options
  • Save taterbase/2630911 to your computer and use it in GitHub Desktop.
Save taterbase/2630911 to your computer and use it in GitHub Desktop.
alpha sorting
partials.sort(function(a, b){
var typeA = a.type.toLowerCase(), typeB = b.type.toLowerCase()
if(typeA < typeB)
return -1;
if(typeA > typeB)
return 1;
return 0 //default return value (no sorting)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment