Created
November 9, 2018 00:21
-
-
Save AminBusiness/3faece9a13d7da81bd49f4cb9cde1c97 to your computer and use it in GitHub Desktop.
// source https://jsbin.com/gavovuh
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
<script id="jsbin-javascript"> | |
// Challenge 2: Validate a palindrome | |
//Return true if palindrome and false if not | |
function isPalindrome(str) | |
{ | |
const revString = str.split('').reverse().join(''); | |
return revString === str; | |
} | |
const output = isPalindrome('racecar'); | |
console.log(output); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">// Challenge 2: Validate a palindrome | |
//Return true if palindrome and false if not | |
function isPalindrome(str) | |
{ | |
const revString = str.split('').reverse().join(''); | |
return revString === str; | |
} | |
const output = isPalindrome('racecar'); | |
console.log(output);</script> |
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
// Challenge 2: Validate a palindrome | |
//Return true if palindrome and false if not | |
function isPalindrome(str) | |
{ | |
const revString = str.split('').reverse().join(''); | |
return revString === str; | |
} | |
const output = isPalindrome('racecar'); | |
console.log(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment