Hello guys, I tried a million different ways to solve that problem but I just can’t go through with if/else statements.
My code looks like this:
function palindrome(str) { var removeSpace=str.replace(" ",""); var allLowerCase=removeSpace.toLowerCase(); var splitStr=allLowerCase.split(); var toArray=splitStr.join(); if (toArray==toArray.reverse()) { return true; } else { return false; } }
Why isn’t it working? As mentioned, I tried different versions of identical code but again the same…