Skip to content

Instantly share code, notes, and snippets.

@vineeshnp
Created November 12, 2017 17:16
Show Gist options
  • Save vineeshnp/ad9cbb1d735f8e4cdfb5ba00158b1cdd to your computer and use it in GitHub Desktop.
Save vineeshnp/ad9cbb1d735f8e4cdfb5ba00158b1cdd to your computer and use it in GitHub Desktop.
Check palindrome in JS
/**
* 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