js对字符串进行去重
var str="aaababacaac"
var newstr=""
function test(str){
for(var i=0;i<str.length;i++){
if(newstr.indexOf(str[i])==-1){
newstr+=str[i]
}
}
console.log(newstr)
}
test(str)
var str="aaababacaac"
var newstr=""
function test(str){
for(var i=0;i<str.length;i++){
if(newstr.indexOf(str[i])==-1){
newstr+=str[i]
}
}
console.log(newstr)
}
test(str)