Skip to content

Instantly share code, notes, and snippets.

@arrbxr
Created January 23, 2018 05:21
Show Gist options
  • Save arrbxr/4a8967e6e965295b037dd20ff0ead2b0 to your computer and use it in GitHub Desktop.
Save arrbxr/4a8967e6e965295b037dd20ff0ead2b0 to your computer and use it in GitHub Desktop.
palindrome check created by arrbxr - https://repl.it/@arrbxr/palindrome-check
function palindrome(str) {
str = str.toLowerCase().replace(/[\w]/g, '');
for(var i = 0, len = str.length - 1; i < len/2; i++) {
if(str[i] !== str[len-i]) {
return false;
}
}
return true;
}
palindrome("ey_e");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment