I’ve been looking this over a while now, so figured I’d finally reach out for help… The error I’m receiving says: TypeError: cleanString.split is not a function
Tell us what’s happening:
Describe your issue in detail here.
**Your code so far**
function palindrome(str) {
let cleanString = str.replace(/\W+|_/g, "").toLowerCase;
let reversedString = cleanString.split("").reverse().join("");
//console.log(cleanString, reversedString)
if (cleanString != reversedString) {
return false;
}
return true;
}
let result = palindrome("racecar");
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Challenge: JavaScript Algorithms and Data Structures Projects - Palindrome Checker
Link to the challenge: