字符串查重去重
function fn(str) {
// 去重
for (let i = 0; i < str.length; i++) {
if (str.indexOf(str[i]) !== str.lastIndexOf(str[i])) {
str = str.replace(str[i], "");
}
}
console.log(str)
}