📅  最后修改于: 2022-03-11 15:03:59.907000             🧑  作者: Mango
function palindrome(str) {
var splitted = str.split("");
var reversed = splitted.reverse("");
var joined = reversed.join("");
return joined.toLowerCase().replace(/[^0-9a-z]/gi, '') == str.toLowerCase().replace(/[^0-9a-z]/gi, '')
}