JavaScriptEasyString Manipulation

Palindrome Checker

Write a function that checks if a string is a palindrome (reads the same forwards and backwards). Ignore case and spaces.

Starter code

JavaScript
function isPalindrome(str) {
  // Your code here
}

console.log(isPalindrome('racecar')); // true
console.log(isPalindrome('hello')); // false

Stuck on this challenge?

Let CodeForge AI help you find the solution.