Check for Palindromes Work

Tell us what’s happening:

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;



Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0.

Link to the challenge:

The code doesn’t run if the string begins with an upper case

Which test is it failing on?
You could try this if(str.toLowerCase() === reverseStr) {

i converted the string to lower case before calling the replace method and it worked