Skip to content

Instantly share code, notes, and snippets.

@ultim8k
Last active September 7, 2016 16:17
Show Gist options
  • Save ultim8k/d5f16a751aac54f3cd6e8b1033f57538 to your computer and use it in GitHub Desktop.
Save ultim8k/d5f16a751aac54f3cd6e8b1033f57538 to your computer and use it in GitHub Desktop.
check palindromic text
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