Palindromes challenge

Palindromes challenge
0

#1

I got some parts correct on this challenge. I just can’t figure out how to add false statements to it.

Your code so far

function palindrome(str) {
  var lower = str.toLowerCase();
  var removeSpecials = str.replace(/[,.1234567890]/g, '');
  
  if (str === lower) {
    return true;
  } else if (lower.reverse().split('')) {
    return true;
  } else if (str === removeSpecials) {
    return true;
  }
}


palindrome("eye");

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36.

Link to the challenge:


#2

The same way you added the true. Use return false; Where should this statement go? If you have covered all the situations where you should return true, then you could use an else block like:

  else {
    return false;
  }

However, you have not yet figured out the true parts yet.