You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

solution-exercise-4.js 272B

1234567891011
  1. function isPalindrome (input) {
  2. const regex = /[\W_]/g;
  3. input = input.toLowerCase().replace(regex,'');
  4. console.log(input);
  5. if (input === input.split('').reverse().join('')) {
  6. return true;
  7. }
  8. return false;
  9. }
  10. console.log(isPalindrome('0_0 (: /-\ :) 0–0'));