09 format correction

This commit is contained in:
LoptrSir 2022-03-18 11:27:30 -07:00
parent 612360bded
commit 0afea275ee
1 changed files with 14 additions and 11 deletions

View File

@ -1,14 +1,17 @@
const palindromes = function (str) { const palindromes = function(str) {
step1 = str.toLowerCase().replace(/[^a-zA-Z0-9s+]/g, ""); step1 = str
.toLowerCase()
.replace(/[^a-zA-Z0-9s+]/g, '');
result = step1.split('').reverse().join(''); result = step1.split('').reverse().join('');
if (result == step1){ if (result == step1) {
console.log(result); console.log(result);
return true return true;
}else {console.log('False')} } else {
return false console.log('False');
}
}; return false;
// palindromes('123, 321'); };
// palindromes('123, 321');
// Do not edit below this line // Do not edit below this line
module.exports = palindromes; module.exports = palindromes;