Tell us what’s happening:
In the test case, one of the condition is " palindrome("1 eye for of 1 eye.")
should return false
."
here if I remove all the symbols and numbers I get - eyeforofeye which in reverse is eyeforofey so it should give true. But it’s expecting false. Why?
**Your code so far**
function palindrome(str) {
const arr = str.match(/[a-z]/gi)
if (arr === null) {
return true;
}
str = arr.join("").toLowerCase()
const rev_str = arr.reverse().join("").toLowerCase()
if(str === rev_str) {
return true;
}
return false;
}
palindrome("eye");
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36
Challenge: Palindrome Checker
Link to the challenge: