Promise.all抛出不能在执行时设置未定义的属性“ null”吗?

时间:2019-03-18 15:37:00

标签: javascript node.js promise

为什么这会引发错误?

[x, y] = await Promise.all([
    this.somefunction1(),
    this.somefunction2()
]);

但这不是吗?

let [a, b] = await Promise.all([
    this.somefunction1(),
    this.somefunction2()
]);
x = a
y = b

作为参考,x和y是在函数范围内定义的变量。

0 个答案:

没有答案