Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

what is palindrome

function Palindrome(str) { 

  str = str.replace(/ /g,"").toLowerCase();
  var compareStr = str.split("").reverse().join("");

  if (compareStr === str) {
    return true;
  } 
  else {
    return false;
  } 

}
Source by www.sanfoundry.com #
 
PREVIOUS NEXT
Tagged: #palindrome
ADD COMMENT
Topic
Name
7+5 =