【发布时间】:2017-09-27 12:28:39
【问题描述】:
在回调中,我们可以发送任意数量的参数。
同样,我想将多个参数传递给 then 函数,无论是在 Bluebird 承诺还是原生 JavaScript 承诺中。
像这样:
myPromise.then(a => {
var b=122;
// here I want to return multiple arguments
}).then((a,b,c) => {
// do something with arguments
});
【问题讨论】:
-
通过属性传递对象
标签: javascript callback ecmascript-6 promise bluebird