odin-javascript-exercises/09_palindromes/solution/palindromes-solution.js

7 lines
217 B
JavaScript
Raw Normal View History

2022-02-20 11:07:44 -08:00
const palindromes = function (string) {
processedString = string.toLowerCase().replace(/[^a-z]/g, '');
return processedString.split('').reverse().join('') == processedString;
};
module.exports = palindromes;