问答题962/1515【Promise第11题】下面代码的输出是什么?

1const promise1 = new Promise((resolve, reject) => { 2 setTimeout(() => { 3 resolve('success') 4 }, 1000) 5}) 6const promise2 = promise1.then(() => { 7 throw new Error('error!!!') 8}) 9console.log('promise1', promise1) 10console.log('promise2', promise2) 11setTimeout(() => { 12 console.log('promise1', promise1) 13 console.log('promise2', promise2) 14}, 2000)
难度:
2022-01-09 创建

赞赏支持

预览

题库维护不易,您的支持就是我们最大的动力!