A student learning JavaScript was trying to make a function that sorts all the letters of a word, but their code is broken, and they can't figure out why.
Spot and fix the error(s) in the code to make the function work.
sortWord("dcba") ➞ "abcd"
sortWord("Unpredictable") ➞ "Uabcdeeilnprt"
sortWord("pneumonoultramicroscopicsilicovolcanoconiosis") ➞ "aacccccceiiiiiilllmmnnnnooooooooopprrsssstuuv"
Input is a word.