Created
May 7, 2012 22:17
-
-
Save taterbase/2630911 to your computer and use it in GitHub Desktop.
alpha sorting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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