Skip to content

Instantly share code, notes, and snippets.

@cooncesean
Created July 13, 2017 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cooncesean/afd907602d959fc4bbaa18dfd6b2a83b to your computer and use it in GitHub Desktop.
Save cooncesean/afd907602d959fc4bbaa18dfd6b2a83b to your computer and use it in GitHub Desktop.
unsortedWords = ['f', 'fff', 'asb', 'a', 'asdfsd', '23', 'adsfadsf'];
unsortedWords.sort(function(a, b) {
var textA = a.toUpperCase();
var textB = b.toUpperCase();
return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment