_.sortByName() #underscore #mixin #cc
_.mixin({ | |
// - Sort a list alphabetically | |
sortByName : function(a, b) { | |
var x = a.name.toLowerCase(); | |
var y = b.name.toLowerCase(); | |
return ((x < y) ? -1 : ((x > y) ? 1 : 0)); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment