loading...

re: Javascript Algorithms #2: Palindromes VIEW POST

TOP OF THREAD FULL DISCUSSION
re: those memories of solving algorithms at freecodecamp.org const isPalindrome = str => str.toLowerCase() === str.toLowerCase().split().reverse(...
 

nice, somehow didn't work until i added the splitters for split() and join()

const isPalindrome = str => str.toLowerCase() === str.split('').reverse().join('')
 

Thanks for the save. I didn't even look at the syntax closely. It's still a pretty concise solution though

 

thats why we needs unit tests 😅

code of conduct - report abuse