cf.completefrontend

Predict the outputMedium

Does this try/catch catch the error thrown in the setTimeout callback?

What does this log?
try {
  setTimeout(() => {
    throw new Error("late failure");
  }, 0);
  console.log("timer scheduled");
} catch (error) {
  console.log("caught", error.message);
}
 
console.log("script done");
 
setTimeout(() => {
  try {
    throw new Error("handled inside");
  } catch (error) {
    console.log("caught", error.message);
  }
}, 10);

The answer

Work out every line it logs, in order. Then check.

Checking your sign-in…