Created
September 28, 2011 14:51
-
-
Save hanksudo/1248139 to your computer and use it in GitHub Desktop.
Detect string is_palindrome or not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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