Skip to content

Instantly share code, notes, and snippets.

@platypusrex
Last active October 15, 2015 04:05
Show Gist options
  • Save platypusrex/22bc14b8141feaa179ff to your computer and use it in GitHub Desktop.
Save platypusrex/22bc14b8141feaa179ff to your computer and use it in GitHub Desktop.
Javascript - Check for Palindrones
function palindrome(str) {
return str.replace(/\W|_/gi, '').toLowerCase() === str.split('').reverse().join().replace(/\W|_/gi, '').toLowerCase() ? true : false;
}
palindrone('race car');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment