Tell us what’s happening:
Describe your issue in detail here.
With respect to the part of the function where I am using the .reverse() I am getting
this error: TypeError: alphaNumStr.reverse is not a function
I don’t understand how I am suppose to write this for it to accept my if statement.
function palindrome(str) {
let alphaNumStr = str
//change to Lowercase
.toLowerCase()
//change to alpha numeric only
.match(/[a-z0-9]/g)
.join()
//does reverse string = str
if(alphaNumStr === alphaNumStr.reverse()){
return true;
}
}
palindrome("eye");
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Challenge: Palindrome Checker
Link to the challenge: