DEV Community

Discussion on: Code Golf Challenge: Palindrome Detector

Collapse
 
maxart2501 profile image
Massimo Artizzu • Edited
[...word].reverse().join('')==word
Enter fullscreen mode Exit fullscreen mode

On the plus side, it works on emojis (.split('') doesn't), but not on complex ones (like ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ).

Collapse
 
siddharthshyniben profile image
Siddharth

you can shave off 2 chars by doing .join``