Answers for "how to check palindrome in javascript for lowercase and uppercase"

0

how to check palindrome in javascript for lowercase and uppercase

function palindrome(str) {
  var re = /[\W_]/g;
  var lowRegStr = str.toLowerCase().replace(re, '');
  var reverseStr = lowRegStr.split('').reverse().join(''); 
  return reverseStr === lowRegStr;
}
palindrome("A man, a plan, a canal. Panama");
Posted by: Guest on July-27-2020

Code answers related to "how to check palindrome in javascript for lowercase and uppercase"

Code answers related to "Javascript"

Browse Popular Code Answers by Language