Hi There,
I want to know why this is not a pallindrome:
palindrome("1 eye for of 1 eye.")
should return false
.
i take the letters and it seems to be a pallindrome.
Can Anybody tells me what im not seeing?
**Your code so far**
function palindrome(str) {
let regex = /[\W*0-9_-]/gi;
let word = str.split(regex).join("").toLowerCase();
let wordRev =[];
for(let i =word.length-1;i>=0;i--){
wordRev.push(word[i]);
}
return wordRev.every((item, index)=>(item === word[index]));
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
Challenge: JavaScript Algorithms and Data Structures Projects - Palindrome Checker
Link to the challenge: