Palindrome checker is not working proprly

Palindrome checker is not working proprly
0.0 0

#1

Tell us what’s happening:
I am running this code…but on the output console it just shows running,but not executing the code. please help me out.I am not getting the idea how to run the code

Your code so far



function palindrome(str) {
  str = str.replace(/[\W_]/g, "");
    
  var reverseStr =str.toLowerCase().split("").reverse().join("");
  
  if(str === reverseStr) {
      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/64.0.3282.140 Safari/537.36 Edge/17.17134.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/palindrome-checker/


#2

The ones you are failing are the ones involving capitalization. That’s because you convert reverseStr to lowercase, but you never do for str, so it fails because “M” isn’t the same thing as “m”.