All tests pass

This commit is contained in:
billalp 2019-11-01 14:14:18 +00:00
parent 27afb52393
commit 07ced0fc05
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
const palindromes = function(word) {
const wordArr = word.replace().toLowerCase().split('');
const wordArr = word.replace(/\W/g, '').toLowerCase().split('');
const reversedArray = wordArr.reverse();
newArray = [];
@ -11,7 +11,7 @@ const palindromes = function(word) {
break;
}
}
return true ? newArray.join('') === word : false;
return true ? newArray.join('') === word.replace(/\W/g, '').toLowerCase() : false;
}
module.exports = palindromes