Files
30-seconds-of-code/test/palindrome/palindrome.js
2018-01-09 06:09:49 -05:00

10 lines
131 B
JavaScript

module.exports = str => {
const s = str.toLowerCase().replace(/[\W_]/g, '');
return (
s ===
s
.split('')
.reverse()
.join('')
);
};