Skip to content

Instantly share code, notes, and snippets.

@abm0
Created June 8, 2018 21:03
Show Gist options
  • Save abm0/09c20aa3af62a1ff1d0bd21db7962b1f to your computer and use it in GitHub Desktop.
Save abm0/09c20aa3af62a1ff1d0bd21db7962b1f to your computer and use it in GitHub Desktop.
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