Last active
May 10, 2021 14:21
-
-
Save RahmatSaeedi/ba873aca1b5ff2de8f49df67baed2e21 to your computer and use it in GitHub Desktop.
CodeSignal - Arcade - Intro - JS - checkPalindrome
This file contains 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 checkPalindrome(inputString) { | |
for(let i = 0; i<Math.floor(inputString.length/2); i++) { | |
if(inputString[i] != inputString[inputString.length - i-1]){ | |
return false; | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment