Created
May 21, 2017 22:23
-
-
Save AWattNY/1fae83d8de8756c9d9b946e36307e8fc 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
const isPalindrome = (string) => { | |
const reverse = string.split('').reverse().join(''); | |
const isPalindrome = (string === reverse); | |
const result = isPalindrome ? `${string} is a Palindrome` : `${string} is not a Palindrome`; | |
return result; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
const isPalindrome = (string) => {
const reverse = string.toLowerCase().split('').reverse().join('');
const isPalindrome = (string === reverse);
const result = isPalindrome ?
${string} is a Palindrome
:${string} is not a Palindrome
;return result;
};
isPalindrome("aAbcc")