Skip to content

Instantly share code, notes, and snippets.

@dragonza
Created January 28, 2018 16:28
Show Gist options
  • Save dragonza/58e835843fd1396efd41cb4295169b0c to your computer and use it in GitHub Desktop.
Save dragonza/58e835843fd1396efd41cb4295169b0c to your computer and use it in GitHub Desktop.
Palindrome
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