Else Statement in Basic Algorithm Scripting Palindrome Unit isn't working

Hi, can someone tell me why my else statement isn’t working here?

Your code so far

function palindrome(str) {
  if (str.toLowerCase(/\W/g) === str.toLowerCase(/\W/g).reverse()); {
  return true;
  }  
  else 
  {
    return false;
    
  }
}



palindrome("eye");

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/check-for-palindromes

I am not sure if that’s the correct param for toLowerCase()

also reverse() is an Array function, not a String function…
you are using reverse() on a String.


i see. but is the else statement not working because of this?