Sharpen Your JavaScript Skills with These Coding Exercises
Exercise 1: Reverse a String Write a function reverseString that takes a string as input and returns the reverse of that string. function reverseString(str) { return str.split(”).reverse().join(”); } // Example usage: console.log(reverseString(‘Hello’)); // Output: “olleH” Exercise 2: Check for Palindrome Write a function isPalindrome that checks if a given string is a palindrome (reads the … Read more