1const promise1 = new Promise((resolve, reject) => { 2 console.log('promise1') 3 resolve('resolve1') 4}) 5const promise2 = promise1.then(res => { 6 console.log(res) 7}) 8console.log('1', promise1); 9console.log('2', promise2);
参考答案:
'promise1'
'1' Promise{<resolved>: 'resolve1'}
'2' Promise{<pending>}
'resolve1'
最近更新时间:2024-07-20