承诺的回报价值?

时间:2016-08-18 18:03:14

标签: javascript

catch的MDN文档表明函数的返回值是“承诺”。

var p1 = new Promise(function(resolve, reject) {
  resolve('Success');
});
p1.then(function(value) {
  throw 'oh, no!';
}).catch(function(e) {
  return "some other value";  // where does this go?
})

catch块中的返回是否有任何影响,即它是否作为已解析的Promise传递给其他块?

0 个答案:

没有答案
相关问题