Games Node.js Loop Quest Events and errors
try/catch misses the future
A try/catch around a setTimeout that throws.
process.on('uncaughtException', (e) => console.log('crashed: ' + e.message));try { setTimeout(() => { throw new Error('late'); }, 0);} catch (e) { console.log('caught');}console.log('done');1. Predict the output
Tap the lines in the order you think they print.
- 1…
- 2…