标签: Promise

1 篇文章

【JavaScript】手写 Promise.all
要点: 知道要在 Promise 上写而不是在原型上写 知道 all 的参数(Promise 数组)和返回值(新 Promise 对象) 知道用数组来记录结果 知道只要有一个 reject 就整体 reject Promise.prototype.myAll Promise.myAll = function(list){ const results…