2022-02-20 11:07:44 -08:00
|
|
|
const palindromes = function (string) {
|
2023-05-19 23:37:41 -07:00
|
|
|
const processedString = string.toLowerCase().replace(/[^a-z0-9]/g, "");
|
2023-01-21 09:53:41 -08:00
|
|
|
return processedString.split("").reverse().join("") == processedString;
|
2022-02-20 11:07:44 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = palindromes;
|