JavaScript Palindrome Checker project

I have a concern about the palindrome checker project. I’ve got most of the tests right, but I’m having trouble with these two:

palindrome("_eye") should return true .
palindrome("0_0 (: /-\ :) 0-0") should return true .

I don’t understand how "_eye" should return true, because the string backwards would be "eye_", so it wouldn’t be a palindrome. I have the same issue with the second test. The string "0_0 (: /-\ :) 0-0" also wouldn’t be the same backwards because there’s two different characters present between the pairs of zeroes ( - and _ ).

Can anyone help me out with this?

Note: You’ll need to remove all non-alphanumeric characters (punctuation, spaces and symbols) and turn everything into the same case (lower or upper case) in order to check for palindromes.

_ and - are non-alphanumeric characters.

@ArielLeslie Okay thanks. I edited the regular expression in my code to exclude those. Sorry if this might have been a dumb question but I’m still learning and I got a little confused when reading the instructions.

It’s not a dumb question. You gotta learn somehow :slight_smile:

1 Like

@ArielLeslie Thanks, but I feel like the solution was so obvious and right there in front of me that I should’ve realized it.

Be gentle with yourself. One of the skills you’re learning is how to read technical requirements. It’s perfectly normal for things to feel obvious in retrospect, but try not to get caught up in negative thinking. The goal is progress, not perfection.

Happy coding!

@ArielLeslie Thank you. I did solve most of the tests on my own except for those two, so that’s something to be proud of. I appreciate the support :blush:

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