1
Promise.all=(proArr) =>{
    return new Promise((resolve, reject) => {
        let retsult = []
        let count = 0
        for (let i = 0; i < proArr.length; i++) {
            proArr[i].then(data => {
                retsult[i]=data
                if(++count===proArr.length){
                    resolve(retsult)
                }
            }, reject)
        }
    })
}
Promise.race=(promiseAry)=> {
    return new Promise((resolve, reject) => {
      for (let i = 0; i < promiseAry.length; i++) {
        promiseAry[i].then(resolve, reject)
      }
    })
  }

WARRIOR
25 声望3 粉丝