Skip to content

Instantly share code, notes, and snippets.

@jordanhudgens
Created September 12, 2018 02:55
Show Gist options
  • Save jordanhudgens/3db59edd4f1024857ae2d98009a0e943 to your computer and use it in GitHub Desktop.
Save jordanhudgens/3db59edd4f1024857ae2d98009a0e943 to your computer and use it in GitHub Desktop.
const isPalindrome = (str) => {
return str.split('').reverse().join() === str.split('').join();
}
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