Skip to content

Laboratory · JavaScript Lab

Promise vs setTimeout

Briefing

Given nested timeouts, promise chains and an async function, in what order does the output appear?

Predict the output first. Then watch the queues prove you right, or, more usefully, wrong.

Laboratory
JavaScript Lab
Level
DEVELOPER
Estimated time
6 minutes
Method
thought
Variables under observation
microtasktaskasync/awaitprediction