Skip to content

Instantly share code, notes, and snippets.

@stevenmaguire
Created July 29, 2012 01:31
Show Gist options
  • Save stevenmaguire/3195624 to your computer and use it in GitHub Desktop.
Save stevenmaguire/3195624 to your computer and use it in GitHub Desktop.
JavaScript method to determine if a word is a palindrome
function isPalindrome(word) {
var letters = word.split('');
var length = letters.length;
for (i in letters) {
if (letters[i] != letters[(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