Created
September 20, 2019 19:37
-
-
Save alesanabv/1009f7c55bcce6490f49017a088a174d to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/giboqiy
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
function isPalindrome(word) { | |
const validChar = "abcdefghijqlmnopqrstuvwxyz".split(""); | |
let arrChar = word.toLowerCase().split(""); | |
arrChar = arrChar.filter(char => validChar.indexOf(char) != -1); | |
if(arrChar.join("") === arrChar.reverse().join("")) { | |
return true; | |
} | |
return false; | |
} | |
if(isPalindrome("race ca")) { | |
console.log('yes'); | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript"> | |
function isPalindrome(word) { | |
const validChar = "abcdefghijqlmnopqrstuvwxyz".split(""); | |
let arrChar = word.toLowerCase().split(""); | |
arrChar = arrChar.filter(char => validChar.indexOf(char) != -1); | |
if(arrChar.join("") === arrChar.reverse().join("")) { | |
return true; | |
} | |
return false; | |
} | |
if(isPalindrome("race ca")) { | |
console.log('yes'); | |
}</script></body> | |
</html> |
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 isPalindrome(word) { | |
const validChar = "abcdefghijqlmnopqrstuvwxyz".split(""); | |
let arrChar = word.toLowerCase().split(""); | |
arrChar = arrChar.filter(char => validChar.indexOf(char) != -1); | |
if(arrChar.join("") === arrChar.reverse().join("")) { | |
return true; | |
} | |
return false; | |
} | |
if(isPalindrome("race ca")) { | |
console.log('yes'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment