Skip to content

Instantly share code, notes, and snippets.

@usmanity
Created August 6, 2015 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usmanity/72d67ad9c48475bae719 to your computer and use it in GitHub Desktop.
Save usmanity/72d67ad9c48475bae719 to your computer and use it in GitHub Desktop.
a simple gist for finding a palindrome in javascript
function isPalindrome(p){
if (p.length == 0 || p.length == 1) {
return true;
} else if (p[0] == p[p.length - 1]) {
return isPalindrome(p.slice(1, p.length - 1));
} else {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment