Reverse a string
Write a JavaScript function to reverse a string.
Sample Code:
function reverseString(str) {
// Enter your logic here...
}
Examples:
Input: 'Codetisan'
Output: 'nasitedoC'
Explanation: The reverse of 'Codetisan' is 'nasitedoC'.
Input: 'apple'
Output: 'elppa'
Explanation: The reverse of 'apple' is 'elppa'.