Skip to content

Instantly share code, notes, and snippets.

@ahafidi
Created February 13, 2018 19:46
Show Gist options
  • Save ahafidi/4e2e85857a6bfba025da42da6c297d8d to your computer and use it in GitHub Desktop.
Save ahafidi/4e2e85857a6bfba025da42da6c297d8d to your computer and use it in GitHub Desktop.
const palindrome = str => {
const s = str.toLowerCase().replace(/[\W_]/g, '');
return s === s.split('').reverse().join('');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment