all的要保证顺序的话是不是可以这样 Promise._all = (arr) => { return new Promise((resolve, reject) => { arr = [...arr]//将可迭代对象变为数组 let ans = [] let count = 0 for (let i = 0; i < arr.length; i++) { //并行开启 Promise.resolve(arr[i]).then((val) => {//不用push保存用下标保证顺序 count++ ans[i] = val if (count === arr.length) { resolve(ans) } }).catch((e) => { reject(e) }) } }) }