9 lines
237 B
JavaScript
9 lines
237 B
JavaScript
|
function palindrome(str) {
|
||
|
const upper = str.toUpperCase();
|
||
|
const letters = upper.match(/[A-Z0-9]/g);
|
||
|
|
||
|
if (letters.toString() === letters.reverse().toString()) return true;
|
||
|
else return false;
|
||
|
}
|
||
|
console.log(palindrome("e_ye 3"));
|