function set (arr) {
let len = arr.length;
for (let i = 0; i < len-1; i++) {
for (let j = i+1; j < len; j++) {
if (arr[i] === arr[j]) {
arr.splice(j, 1);
len = arr.length;
j--;
}
}
}
}
网友评论