Last active
May 1, 2018 05:43
-
-
Save Luke-Rogerson/ecf4494004a0980748400937bdf5012b to your computer and use it in GitHub Desktop.
AlphabetSoup algorithm challenge created by Luke_Rogerson - https://repl.it/@Luke_Rogerson/AlphabetSoup
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
/* | |
have the function AlphabetSoup(str) take the str string parameter being passed and return the string with the letters in alphabetical order (ie. hello becomes ehllo). Assume numbers and punctuation symbols will not be included in the string. | |
*/ | |
function AlphabetSoup(str) { | |
var strArray = str; | |
return strArray.split("").sort().join(""); | |
} | |
AlphabetSoup("hooplah"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment