DEV Community


Discussion on: Vanilla JavaScript palindrome checker in 3 lines

toanoop profile image
Anoop Sivadas

const checkPalin = words => words.split('').reverse().toString() === words.split('').toString()?'The word is a palindrome':'The Word is not a palindrome';

in a single line .....

dailydevtips1 profile image
Chris Bongers Author

Yes nice one Anoop, was mentioned above as well, I just like to showcase the code more readable for new people 🤟

Forem Open with the Forem app