Skip to content

Instantly share code, notes, and snippets.

@wellingguzman
Created September 10, 2014 16:33
Show Gist options
  • Save wellingguzman/a56321c8f48a9229d75f to your computer and use it in GitHub Desktop.
Save wellingguzman/a56321c8f48a9229d75f to your computer and use it in GitHub Desktop.
function isPalindrome(string) {
string = ""+string;
var len = string.length;
if (len<=1) {
return true;
}
if (string[0] === string[len-1])
return iiPalindrome(string.slice(1, -1));
return false;
}
var string = "racecar";
console.log(isPalindrome(string));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment