Skip to content

Instantly share code, notes, and snippets.

@jordanhudgens
Last active September 12, 2018 16:06
Show Gist options
  • Save jordanhudgens/d025679595c321d6b25ea7f5155d55e9 to your computer and use it in GitHub Desktop.
Save jordanhudgens/d025679595c321d6b25ea7f5155d55e9 to your computer and use it in GitHub Desktop.
const isPalindrome = str => {
return (
str
.split("")
.reverse()
.join() === str
);
};
isPalindrome("tacocat"); // true
isPalindrome("racecar"); // true
isPalindrome("asdf"); // false
isPalindrome("nope"); // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment