SyntaxStudy
Sign Up

Reverse a String

JAVASCRIPT Easy +10 XP
Problem Description
Write a function `reverseString(str)` that returns the string reversed.

Example:
reverseString('hello') → 'olleh'
reverseString('world') → 'dlrow'
reverseString('abcd') → 'dcba'

Test Cases

1
Input: reverseString('hello')
Expected: olleh
2
Input: reverseString('world')
Expected: dlrow
3
Input: reverseString('abcd')
Expected: dcba
4
Input: reverseString('')
Expected:
Your Solution