odin-default-js-exercises/palindromes/palindromes.js

12 lines
246 B
JavaScript
Raw Normal View History

const palindromes = function(string) {
processedString = string.toLowerCase().replace(/[^A-Za-z]/g, "");
return (
processedString
.split("")
.reverse()
.join("") == processedString
);
};
2017-08-25 19:07:28 +00:00
module.exports = palindromes;