← Back to challenges

Alphabet Soup

JavaScriptHardstringssortingformatting

Instructions

Create a function that takes a string and returns a string with its letters in alphabetical order.

Examples

AlphabetSoup("hello") ➞ "ehllo"

AlphabetSoup("daiebt") ➞ "abdeit"

AlphabetSoup("hacker") ➞ "acehkr"

AlphabetSoup("geek") ➞ "eegk"

AlphabetSoup("javascript") ➞ "aacijprstv"

Notes

You can assume numbers and punctuation symbols won't be included in test cases. You'll only have to deal with single word, alphabetic characters.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Difference of Max and Min Numbers in Array