Reverse a string
EasyStrings · JavaScript
The task
Write reverseString(s) that returns the characters of s in reverse order.
An empty string should return an empty string.
Examples
- reverseString("hello") returns "olleh"
- reverseString("") returns ""
Your code runs in your browser, in a separate worker, and is never sent to us. Edit the function, then press Run tests. Your work is saved here as you type.
JavaScriptCtrl or Cmd + Enter to run