Created
July 13, 2017 21:46
-
-
Save cooncesean/afd907602d959fc4bbaa18dfd6b2a83b to your computer and use it in GitHub Desktop.
This file contains 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
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