Skip to content

Instantly share code, notes, and snippets.

@svahora
Last active August 29, 2015 14:24
Show Gist options
  • Save svahora/26b119ce6b28c94d2546 to your computer and use it in GitHub Desktop.
Save svahora/26b119ce6b28c94d2546 to your computer and use it in GitHub Desktop.
function palindrome(str) {
str = str.replace(/ |[,.]/g, '').toLowerCase();
rts = str.split('').reverse().join('');
if(str === rts) {
return true;
} else {return false;}
}
palindrome("eye");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment