cf.completefrontend

Predict the outputEasy

In what order do a resolved promise's then and a zero-delay setTimeout run?

What does this log?
console.log("start");
setTimeout(() => console.log("timeout"), 0);
Promise.resolve().then(() => console.log("promise"));
console.log("end");

The answer

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

Checking your sign-in…