← Back to challenges

True Alphabetical Order

JavaScriptHardstringsloops

Instructions

Create a function which takes every letter in every word, and puts it in alphabetical order. Note how the original word lengths must stay the same.

Examples

trueAlphabetic("hello world") ➞ "dehll loorw"

trueAlphabetic("innokodakademija is awesome") ➞ "aabdee ei imosstw"

trueAlphabetic("have a nice day") ➞ "aaac d eehi nvy"

Notes

  • All sentences will be in lowercase.
  • No punctuation or numbers will be included in the Tests.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.