Last active
September 7, 2016 16:17
-
-
Save ultim8k/d5f16a751aac54f3cd6e8b1033f57538 to your computer and use it in GitHub Desktop.
check palindromic text
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 isPalindromic(textStr) { | |
if (!textStr) { return new Error('Missing string parameter.'); } | |
if (typeof textStr !== 'string') { return new Error('Parameter must be a string.'); } | |
return textStr.split('').reverse().join('') === textStr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment