Nothing booked, Node leaves
One timer, a 'beforeExit' listener and an 'exit' listener.
process.on('beforeExit', () => console.log('beforeExit'));process.on('exit', (code) => console.log('exit ' + code));setTimeout(() => console.log('timer'), 10);console.log('main done');1. Predict the output
Tap the lines in the order you think they print.
- 1…
- 2…
- 3…
- 4…