1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| console.log(1); setTimeout(() => { console.log(2); }); process.nextTick(() => { console.log(3); }); setImmediate(() => { console.log(4); }); new Promise(resolve => { console.log(5); resolve(); console.log(6); }).then(() => { console.log(7); }); Promise.resolve().then(() => { console.log(8); process.nextTick(() => { console.log(9); }); });
|