网上一个比较有意思的前端面试题:
原文地址:
https://juejin.im/post/5c8610a7f265da2de970b3ab
看了很多网友的思路,总结和分析了一下,有些比较好理解有些也比较难理解:
http://www.qiutianaimeili.com/html/page/2019/03/8rfqp1yeul5.html
1
disflyer 2019-03-21 11:27:34 +08:00 1
let resolve = Promise.resolve()
arr.map((el) => { resolve = resolve.then(() => { return new Promise(el) }) }) |
2
qiutianaimeili OP @disflyer 好思路
|
3
akatquas 2019-03-21 12:03:37 +08:00 via iPhone
构建 promise 队列,方法很多
|