欧尹恒

Results 3 comments of 欧尹恒

``` function setArr(arr) { if(arr.length==5) return; const num = parseInt((Math.random())*31+2); if(arr.indexOf(num) === -1) arr.push(num) return setArr(arr); } ```

```js function sleep(wait) { let date = new Date().getTime(); console.log('wait...') while ((new Date().getTime()) - date < wait) { continue; } } ```

``` const list = ['上海', '上海市', '上海海昌海洋公园', '上海市徐汇区', '上海自来水来自海上']; function setList(value) { const ul = document.querySelector('.options'); ul.innerHTML = ''; if (!value) { ul.innerHTML = ''; return; } list.forEach((item, index) =>...