Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
In this video, you will convert many of the project's promise chains to async/await.
Resources
Examples of async/await patterns
// Anonymous async function
(async function() {
const response = await fetch('...');
})();
// Async function assignment
const getData = async function() {
const response = await fetch('...');
};
// Arrow functions
const getData = async () => {
const response = await fetch('...');
};
// Async Function as an argument
btn.addEventListener('click', async () => {
const response = await fetch('...');
});
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Daniel Corio-Rosas
6,995 Points1 Answer
-
juami alcazar
6,443 Points1 Answer
-
PLUS
Spencer Renfro
Courses Plus Student 11,133 Points1 Answer
-
karan Badhwar
Web Development Techdegree Graduate 18,135 Points2 Answers
-
Amanda Richardson
Web Development Techdegree Student 13,776 Points1 Answer
-
Joseph Bertino
Full Stack JavaScript Techdegree Student 14,652 Points1 Answer
-
babyoscar
12,930 Points4 Answers
-
Colton Shaw
12,634 Points0 Answers
-
Steve Fau
5,622 Points1 Answer
-
Steve Fau
5,622 Points1 Answer
-
Marcus Klausen
17,425 Points1 Answer
-
jlampstack
23,932 Points3 Answers
-
michaeldavies3
23,152 Points4 Answers
-
Raksmey soriya
3,101 Points1 Answer
-
Michael Cook
Full Stack JavaScript Techdegree Graduate 28,975 Points1 Answer
-
Seokhyun Wie
Full Stack JavaScript Techdegree Graduate 21,606 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up