首页 > 试题广场 >

以下代码的输出是什么?```javascriptPromis

[单选题]
以下代码的输出是什么?
Promise.resolve()
.then(() => {
console.log(1);
return Promise.resolve(2);
})
.then((val) => {
console.log(val);
});
Promise.resolve()
.then(() => {
console.log(3);
})
.then(() => {
console.log(4);
})
.then(() => {
console.log(5);
});
  • 1 3 2 4 5
  • 1 3 4 2 5
  • 1 3 4 5 2
  • 1 2 3 4 5

这道题你会答吗?花几分钟告诉大家答案吧!