Async programming
This part follows callbacks into promises: the three states of a promise, async and await, Promise.all and Promise.race, an HTTPS client, AbortController and the errors of async code. The part ends with sequential against parallel work and with the event loop underneath both.
61
Callbacks to promises
nested callbacks turned into promises, and a chain that stays flat
Open
62
Promises
the three states, a promise built by hand, and then chained into one catch
Open
63
async and await
async and await, and error handling that reads like plain code
Open
64
Promise.all
many promises at once, one failure, and a list mapped into calls
Open
65
Promise.race
the first promise to settle, a timeout built on it, and when racing fits
Open
66
HTTPS client
text and JSON over HTTPS with the built-in module and typed promises
Open
67
Abort and timeouts
AbortController, a timer that cancels, and the cleanup on both paths
Open
68
Async error handling
a throw through await, a local catch, a guard, and a retry with backoff
Open
69
Sequential vs parallel
tasks in order against tasks at once, and a batch that caps concurrency
Open
70
Event loop
how the loop orders promises and timers, and what keeps it responsive
Open