
- JavaScript
- Intermediate
About this Course
In this course, you will learn why asynchronous code matters and how to write code that avoids blocking behavior using three approaches: callbacks, promises, and async/await.
What you'll learn
- Synchronous vs. asynchronous programming
- Callbacks
- Promises
- Async/await
What is Asynchronous Programming?
In this stage, you'll learn the differences between synchronous and asynchronous code. You'll also get an introduction to the mechanics of asynchronous programming in the browser, learning concepts like JavaScript's call stack and event loop.
6 stepsAsynchronous JavaScript with Callbacks
Asynchronous code is typically structured in a different way than synchronous code. One of the most fundamental ways to structure async programs in JavaScript is with callback functions. In this stage, you'll learn how to use callbacks to handle the results of asynchronous operations, as well as some of the drawbacks and potential pitfalls of using them.
7 stepsUnderstanding Promises
Promises in JavaScript offer a more elegant and human-readable way to manage asynchronous code. In this stage, you'll learn how to create and consume a promise, then how to chain promises together.
11 steps-
What is a Promise?
3:36
-
Create a Promise
4:43
-
Reject a Promise and Handle Errors
3:25
-
Promises Review
-
Create a Promise Review
6 questions
-
From Callbacks to Promises
5:59
-
Handle Multiple Promises with Promise.all
3:35
-
Before You Continue
-
Perform Cleanup With finally()
2:47
-
Using Fetch
6:21
-
JavaScript Promises Review
6 questions
Exploring Async/Await
The keywords async
and await
, together, provide a special syntax that makes working with promise-based code easier and more intuitive –– you write asynchronous code that looks more like synchronous code. In this stage, you'll learn how to combine async/await with traditional promises, and common ways to handle exceptions when working with async/await.
Teacher
-
Guil Hernandez
Guil is a Full Stack JavaScript and Front End Web Development instructor.