Last active
December 26, 2017 18:58
-
-
Save AviTapp/a00d13ee96b01eb1a2fe2c5db5bb9c0b to your computer and use it in GitHub Desktop.
Return true if the given string is a palindrome. Otherwise, return false.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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