CNode

为这段promise代码加注解

问答
IIEfucker发布于10 年前最后回复10 年前0 回复3194 浏览0 收藏

求个大神能为这个代码加下注解,尽量详细些

function chainAnimationsPromise(elem, animations) { let ret = null; let p = currentPromise; for(const anim of animations) { p = p.then(function(val) { ret = val; return anim(elem); }) } return p.catch(function(e) { /* ignore and keep going */ }).then(function() { return ret; }); }

查看回复

回复 (0)

暂无回复,成为第一个参与讨论的人。
参与回复
登录后即可参与回复。登录