Skip to content

Instantly share code, notes, and snippets.

@AviTapp
Last active December 26, 2017 18:58
Show Gist options
  • Save AviTapp/a00d13ee96b01eb1a2fe2c5db5bb9c0b to your computer and use it in GitHub Desktop.
Save AviTapp/a00d13ee96b01eb1a2fe2c5db5bb9c0b to your computer and use it in GitHub Desktop.
Return true if the given string is a palindrome. Otherwise, return false.
function palindrome(e) {
var r = e = e.toLowerCase().replace(/[^a-z0-9]/g, "");
return r === r.split("").reverse().join("")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment