Created
January 28, 2018 16:28
-
-
Save dragonza/58e835843fd1396efd41cb4295169b0c to your computer and use it in GitHub Desktop.
Palindrome
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 palindrome(str) { | |
for (var i = 0; i < str.length / 2; i++) { | |
if (str[i] !== str[str.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