Skip to main content

2 docs tagged with "async"

View all tags

Asynchronous processing

An explanation, with diagrams, of the path from callbacks to Promises and async/await. Covers choosing between Promise.all / allSettled / any, and the execution order driven by microtasks, in a beginner-friendly way.

Event loop — one thread juggling wait time

This chapter explains how JavaScript juggles both communication and timers on a single thread, from the execution order of tasks and microtasks. It covers when the continuation after await runs, why setTimeout(fn, 0) isn't "immediately", how a long task blocks painting and input, and three directions for offloading heavy processing.