How does the JavaScript event loop order a promise and a timeout?
Trace the call stack, then microtasks, then the next macrotask.
Frontend and full-stack engineers
The event loop, promises, and the browser behavior interviewers ask you to trace.
Trace the call stack, then microtasks, then the next macrotask.