Something wrong with my regex on palindrome checker challange

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

function palindrome(str) {
let removedObj = str.replace(/[^a-zA-z0-9\w]+|\_/gi,"")
console.log(removedObj)
let basicObj = removedObj.split("").reverse().join("")
if (removedObj === basicObj){
return true
} else{
return false
}
}

console.log(palindrome("_eye"));
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36 Edg/90.0.818.66

Challenge: Palindrome Checker

Link to the challenge:

I would focus on the instructions again:

“A palindrome is a word or sentence that’s spelled the same way both forward and backward, ignoring punctuation, case, and spacing.”

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.