CodeMIRAI
0 XP

Reverse the words

Easy +30 XP Solved

Read a line of words and print the words in reverse order, separated by single spaces.

one two three becomes three two one.

Input
one two three
Expected output
three two one
Input
solo
Expected output
solo
Show a hint

Arrays have a reverse() method, and join(" ") turns an array back into a sentence.

Show a solution
JavaScript
Loading the editor…
Run the tests to check your solution.