Created
June 12, 2017 18:41
-
-
Save BeKnowDo/f2e044858bf2c3b14ab7841f24f9ffb1 to your computer and use it in GitHub Desktop.
Palindrome
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 palindrome(string) { | |
let reverseString = string.split('').reverse().join('') | |
return reverseString === string | |
} | |
document.querySelector('#test').innerHTML = palindrome('level') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment