ZhangQi

Results 3 comments of ZhangQi

;(function (arr) { const obj = {}; [...new Set(arr)].sort((a, b) => a - b).forEach(el => { const key = Math.floor(el / 10) if(obj[key]){ obj[key].push(el) } else { obj[key] = [el]...

```javascript const SOURCE_LEN = 100000 const source = Array.from({ length: SOURCE_LEN }).map((item, i) => i) function getRadomList(source, length) { // 随机取 不重复 可以利用 Set 的唯一性 const keys = new Set();...

> ``` > const bigArr = Array.from({length: 1e5}, (v, i) => i) > const resultArr = []; > const keySet = new Set(); > let count = 0; > >...