Level 35

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. 1…
  2. 2…