JavaScript
⏳ Asynchrony: promises and async/await
Understand how JavaScript handles tasks that take time, with callbacks, promises and async/await.
What you'll learn
- Explain how the event loop runs asynchronous tasks on a single thread without blocking.
- Consume promises with
then/catchand rewrite the flow withasync/await. - Predict the execution order distinguishing microtasks (
.then) from macrotasks (setTimeout). - Combine promises with
Promise.all,allSettled,raceandany, and handle rejections withtry/catch.
Lessons
The event loop and callbacksHow JavaScript does several things without blocking. PromisesAn object that represents a future result. async / await and Promise.allWrite asynchronous code as if it were synchronous. Microtasks vs macrotasksWhy a .then beats a setTimeout(0). Promise combinatorsall, allSettled, race and any: when to use each one. Asynchronous errorstry/catch with await, .catch() and uncaught rejections.Practice this module in the app
DevPath is a hands-on course: you read the theory here; in the app you put it into practice with exercises that really run, offline.
Start free in the app →