Predict the Event Loop
Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.
The problem
- medium
- Pro
A script does four things in this order: it logs A; it schedules a timeout with zero delay that logs B; it creates an already-resolved promise whose then callback logs C; and it logs D. Say in what order the letters are printed, and explain why using the call stack, the task queue and the microtask queue.
Talk this problem through with an AI coach
This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.