Skip to content

Instantly share code, notes, and snippets.

@mralexho
Created Mar 1, 2016
Embed
What would you like to do?
Alpha sort
myArr.sort(function(a, b) {
var aName = a.text.toLowerCase();
var bName = b.text.toLowerCase();
return ((aName < bName) ? -1 : ((aName > bName) ? 1 : 0));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment