DEV Community

loading...

Discussion on: Javascript Algorithms Challenges | Part 1

Collapse
thiht profile image
Thibaut Rousseau

The code for isPalindrome is not working, punctuation must be handled

Collapse
zackarnault profile image
Zack Arnault

I just used str = str.toLowerCase().replace(/[a-zA-Z0-9]/ig, ""); to check for special characters and remove them. ^

Collapse
martinnrdstrm profile image
Martin Nordström Author

smart to use regex!!

Collapse
martinnrdstrm profile image
Martin Nordström Author

Oh that's true! I wrote that in repl.it hehe