Help on basic algorithm section

Help on basic algorithm section
0.0 0

#1

Hi. What am I doing wrong here?

This code returns palindromes as true…but not non-palindromes as false.

Thanks

function palindrome(str) {
if (str === str.split().reverse().join()) {
return true;
}
return false;
}

palindrome(“eye”);


#2

So close!
Your split() and join() methods are missing separators.
Use split("") and join("") and it will work. You want to separate each individual letter and then join again.