Guided Notes

Async JavaScript & Promises

Timers, callbacks, promises, async/await, and fetching data from APIs.

Why async?

Slide 1 / 5

Some work takes time: downloading data, waiting for a timer, reading a file. If JavaScript stopped and waited, the page would freeze.

Instead, it starts the slow task, carries on with other code, and handles the result when it's ready. That's asynchronous programming.

JavaScript runs one thing at a time; the event loop picks up finished async tasks once the current code is done.

← Errors & Debugging