re: Javascript Algorithms #2: Palindromes VIEW POST


those memories of solving algorithms at freecodecamp.org

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


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