Skip to content

Instantly share code, notes, and snippets.

@grigorkh
Last active July 23, 2021 15:32
Show Gist options
  • Save grigorkh/a38ec0dcfde10a6ef43bdc7a552552b1 to your computer and use it in GitHub Desktop.
Save grigorkh/a38ec0dcfde10a6ef43bdc7a552552b1 to your computer and use it in GitHub Desktop.
function isPalindrome(str) {
str = str.replace(/\W/g, '').toLowerCase();
return (str == str.split('').reverse().join(''));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment