Skip to content

Instantly share code, notes, and snippets.

@IAmAnubhavSaini
Created November 18, 2015 19:18
Show Gist options
  • Save IAmAnubhavSaini/7001564b9cd0f367c985 to your computer and use it in GitHub Desktop.
Save IAmAnubhavSaini/7001564b9cd0f367c985 to your computer and use it in GitHub Desktop.
function palindrome(str) {
var nstr = str.match(/[^\W_]+/gi).map(String.toLowerCase).join('');
console.log(nstr);
return nstr === nstr.split('').reverse().join('');
}
palindrome("0_0 (: /-\ :) 0-0");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment