JavaScript lab

Event loop

Step through the call stack, microtasks and tasks to see exactly when each callback runs.

InteractiveThe event loop, step by step
Loading interactive…

In the async/await program, notice that the code after await is queued as a microtask. In the nested program, a microtask queued inside a task still runs before the next task.

Learn the concept

The lesson this lab comes from, with the explanation, a practice task and a quiz.

More labs

All labs