1const first = () => (new Promise((resolve, reject) => { 2 console.log(3); 3 let p = new Promise((resolve, reject) => { 4 console.log(7); 5 setTimeout(() => { 6 console.log(5); 7 resolve(6); 8 console.log(p) 9 }, 0) 10 resolve(1); 11 }); 12 resolve(2); 13 p.then((arg) => { 14 console.log(arg); 15 }); 16})); 17first().then((arg) => { 18 console.log(arg); 19}); 20console.log(4); 21