3 回答

TA贡献1804条经验 获得超2个赞
是这样吗?
是
有没有人考虑过以这种方式构建链的记忆问题?
Promise.each
then
记忆消耗在承诺库之间会有所不同吗?
是的,非常重要。

TA贡献1765条经验 获得超5个赞
then
catch
catch
function foo() { function doo() { // always return a promise if (/* more to do */) { return doSomethingAsync().then(function(){ throw "next"; }).catch(function(err) { if (err == "next") doo(); }) } else { return Promise.resolve(); } } return doo(); // returns a promise}
添加回答
举报