Intermediate
Put the event loop in order
The console should print the letters A, B, C, D, E, F, each on its own line, in that order.
Rules: don't move any line and don't change the letters. You may only wrap a console.log(...) line in setTimeout(() => ..., 0), queueMicrotask(() => ...) or Promise.resolve().then(() => ...).
Predict on paper first: which queue does each letter need to go in?
What Check tests
- The console prints A, B, C, D, E, F in order
- No line was moved
- At least one line uses a microtask
- No errors
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.