Tell us what’s happening:
the criteria I am missing is
````palindrome(“not a palindrome”)should return false.
palindrome(“nope”)should return false.
palindrome(“nope”)should return false.
palindrome(“1 eye for of 1 eye.”)should return false.
palindrome(“five|_/|four”)` should return false.
everything else I have checked.Can someone explain what I am missing please?```
Your code so far
function palindrome(str) {
// Good luck!
let characters = str.replace(/[\W_-]/g, '');
let order = characters.toLowerCase().split('').reverse().join('');
if (str = characters){
return true;
}
else {
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/76.0.3809.132 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/palindrome-checker/