Funtime In function palindrome

Tell us what’s happening:
I don’t know what’s happening :woman_shrugging::woman_facepalming: ,plz help and try to give answer if u can in this solution form only !!!
Mercy :slight_smile:

Your code so far

function palindrome(str) {
function p(str){
    return str !=="(:-/\#%^*+€£$><~,!'ca)- " ;}
  if (str==str.split().reverse().join()){
             return  true;}else{
return false ;}}




palindrome("eye");

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (iPad; CPU OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.0 Mobile/14G60 Safari/602.1.

Link to the challenge:

I’m not sure what you want to do with the p function.

But before you compare the string with its reverse, you should first remove all non-alphanumeric characters. You can do so with regular expressions and .replace()

1 Like