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