Quotes help make search much faster. Example: "Practice Makes Perfect"

Friday, May 12, 2017

FreeCodeCamp Check For Palindromes Sample Solution


function palindrome(str) {
  // Good luck!
  var temp = str.toLowerCase().replace(/[^0-9a-zA-Z]/gi, '');
  if(temp === temp.split('').reverse().join('')){
    return true;
  } else {
    return false;
  }
}

palindrome("_eye");

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts