const arr = []
for (let i = 0; i < 10000; i++) {
const tempStr = Math.random().toString(36).substr(2, 6)
arr.push(tempStr)
}
//es6提供的new Set也可以去重
let items = new Set(arr)
const result = Array.from(items)
console.log(result)
console.log('去重后的个数:' + result.length)