odin-javascript-exercises/palindromes/palindromes.js
2017-12-15 11:15:57 -06:00

11 lines
246 B
JavaScript

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