Skip to content

Instantly share code, notes, and snippets.

@rmariuzzo
Created March 16, 2012 05:20
Show Gist options
  • Save rmariuzzo/2048608 to your computer and use it in GitHub Desktop.
Save rmariuzzo/2048608 to your computer and use it in GitHub Desktop.
Contest: 1 line of JS: Smallest Palindrome Checker
/**
* Check if a word or phrase is a palindrome in 106 characters of JavaScript.
*/
function isPalindrome(s) {
return s.match(/[a-zA-Z]/g).join('').toLowerCase()==s.match(/[a-zA-Z]/g).reverse().join('').toLowerCase();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment