+ 1
How to make palindrome words checker in JavaScript?
2 ответов
+ 1
Thanks bro
0
// with the help of ES6:
var no = 'palindrome', yes = 'racecar';
const is_palindrome = s => [...s].reverse().join('') == s;
console.log(is_palindrome(no));
console.log(is_palindrome(yes));
/*
sentences needs a few more steps to handle words separators ;)
*/