Skip to content

Instantly share code, notes, and snippets.

@pedroglcbarros
Last active November 17, 2021 22:34
Show Gist options
  • Select an option

  • Save pedroglcbarros/10dfd6a48396f5c9d636e7488e899b7d to your computer and use it in GitHub Desktop.

Select an option

Save pedroglcbarros/10dfd6a48396f5c9d636e7488e899b7d to your computer and use it in GitHub Desktop.
Palindrome Algorithm
function isPalindrome (word) {
invertedString = [];
for (let i = word.length - 1; i >= 0; i--) {
invertedString.push(word[i])
}
return word.toLowerCase() === invertedString.join("").toLowerCase();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment