odin-javascript-exercises/09_palindromes/solution/palindromes-solution.js
2023-01-21 12:53:41 -05:00

6 lines
219 B
JavaScript

const palindromes = function (string) {
const processedString = string.toLowerCase().replace(/[^a-z]/g, "");
return processedString.split("").reverse().join("") == processedString;
};
module.exports = palindromes;