Skip to content

Instantly share code, notes, and snippets.

@Luke-Rogerson
Last active May 1, 2018 05:43
Show Gist options
  • Save Luke-Rogerson/ecf4494004a0980748400937bdf5012b to your computer and use it in GitHub Desktop.
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
/*
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