function yibu(i) {
return new Promise(function (resolve, reject) {
setTimeout(function () {
console.log("hello" + i)
resolve();
}, 1000)
});
}
var start = new Promise(function (resolve) {
resolve();
})
for (let i = 1; i < 10; i++) {
start = start.then(function () {
return yibu(i)
})
}
chrome 原生promise 实现 promise.map
最新推荐文章于 2024-06-07 10:18:22 发布