daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest Mar 26th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     function palindrome(str) {
  2.       let newStr = str.toLowerCase().replace(/[\W_]/g, '');
  3.       for(var i = 0, len = newStr.length - 1; i < len/2; i++) {
  4.         if(newStr[i] !== newStr[len-i]) {
  5.           return false;
  6.         }
  7.       }
  8.       return true;
  9.     }
  10.  
  11. palindrome("eye");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top