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

10 lines
279 B
JavaScript

const palindromes = function (string) {
let strng = string.replace(/[^\w\']|_/g,'').toLowerCase()
let reverse = strng.split('').reverse().join('');
return (reverse === strng)
};
palindromes('ASDsdfsdf!!')
// Do not edit below this line
module.exports = palindromes;