2020
10-09
10-09
探究一道价值25k的蚂蚁金服异步串行面试题
前言朋友去面试蚂蚁金服,遇到了一道面试题,乍一看感觉挺简单的,但是实现起来发现内部值得一提的点还是挺多的。先看题目:constdelay=(ms)=>newPromise((resolve)=>setTimeout(resolve,ms));constsubFlow=createFlow([()=>delay(1000).then(()=>log("c"))]);createFlow([()=>log("a"),()=>log("b"),subFlow,[()=>delay(1000).then(()=>log("d")),()=>log("e")],]).run(()=>{console.log("done...
继续阅读 >