Skip to content

Instantly share code, notes, and snippets.

@hanksudo
Created September 28, 2011 14:51
Show Gist options
  • Save hanksudo/1248139 to your computer and use it in GitHub Desktop.
Save hanksudo/1248139 to your computer and use it in GitHub Desktop.
Detect string is_palindrome or not
function is_palindrome(str) {
l = str.split('');
for (i=0; i<l.length; i++) {
if(l[i] != l[l.length-1-i]) {
return false;
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment