问答题808/1530【Promise第12题】下面代码的输出是什么?

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

赞赏支持

预览

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