Tell us what’s happening:
My code is basically the same as the basic solution in get a hint. Can someone please let me know why this isn’t working? What am I missing?
Thank you, appreciate it a lot!
Your code so far
function palindrome(str) {
var modifiedString = str.replace(/\W/g, "").toLowerCase.split('').reverse().join('');
var lowerCaseString = str.replace(/\W/g, "").toLowerCase;
if (modifiedString === lowerCaseString) {
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/61.0.3163.100 Safari/537.36
.
Link to the challenge: