Created
June 8, 2018 21:03
-
-
Save abm0/09c20aa3af62a1ff1d0bd21db7962b1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isPalindrome = (string) => { | |
const _string = string.split(' ').join('').toLowerCase(); | |
const reverseString = _string.split('').reverse().join(''); | |
return _string === reverseString; | |
} | |
console.log(isPalindrome('Лазер боре хер обрезал')); // true | |
console.log(isPalindrome('Карл у Клары украл кораллы')); // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment