2. Reverse String

Write a function that reverses a string. The input is given as a string. Do not update the original string. You must do this by returning another string.

Examples:

Input: s = "hello"
Output: "olleh"
Explanation: Reverse the string by creating another string.
Input: s = "Hannah"
Output: "hannaH"
Explanation: Reverse the string by creating another string.
SolutionJavaScript
Test Results
Click "Run Code" to test your solution