Last active
November 17, 2021 22:34
-
-
Save pedroglcbarros/10dfd6a48396f5c9d636e7488e899b7d to your computer and use it in GitHub Desktop.
Palindrome Algorithm
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 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