Created
November 12, 2017 17:16
-
-
Save vineeshnp/ad9cbb1d735f8e4cdfb5ba00158b1cdd to your computer and use it in GitHub Desktop.
Check palindrome in JS
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 returns true if string is palendrome | |
* @params {String} str | |
* @returns {Boolean} | |
*/ | |
function pal(str){ | |
return str === str.split('').reverse().join(''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment