Last active
January 9, 2019 18:13
-
-
Save masterfermin02/ed21222326fad5a7cb17e930116824bb to your computer and use it in GitHub Desktop.
This file contains hidden or 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 is_palindrome(str) | |
{ | |
if(str.length == 1) return true; | |
var lowStr = str.toLowerCase().replace(/[\W]/g, ''); | |
return lowStr.split('').reverse().join('') === lowStr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment