z1948296027

Results 3 comments of z1948296027

```javascript // 例如:[10,21,0,-7,35,7,9,23,18] 输出 5, 7 最小 function getIndex(arr) { let index = null let prev = null arr.forEach((item, currentIndex) => { if (item > 0 && (!prev || item...

> ``` > const req = (url:string):Promise => { > return new Promise((resolve,reject) => { > const xhr = new XMLHttpRequest(); > xhr.open('get',url,true); //这里第三个参数不能为false,会变成同步 > xhr.onload = () => {...

```javascript Array.prototype.splice = function(index, num, ...rest) { let context = this let removeList = [] //index为负值 if (index < 0) { index = index + context.length } //num存在 if(num !=...