Created
June 19, 2016 14:15
-
-
Save zmts/a755508a0960157dbb03f43f26b5f340 to your computer and use it in GitHub Desktop.
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 checkPalindrom(str) { | |
strLowerCase = str.toLowerCase(); | |
var reverse = strLowerCase.split('').reverse().join(''); | |
if (reverse === strLowerCase) { | |
console.log(str + ' ' + 'is Palindrom'); | |
} else { | |
console.log(str + ' ' + 'is not Palindrom'); | |
} | |
} | |
checkPalindrom('Hello'); | |
checkPalindrom('Eve'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment