Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed JavaScript Data Fetching!
You have completed JavaScript Data Fetching!
Preview
See how async/await simplifies promise-based code. Rewrite fetch requests in a clean, top-to-bottom style.
Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
imagine if there were many more steps
needed to be performed on our response.
0:00
We could eventually be chaining
a lot of then methods.
0:03
And while that works, JavaScript
gives us a much cleaner and more readable
0:06
way to write asynchronous code,
async and await.
0:10
Think of async await as a friendlier layer
on top of promises.
0:14
It does the same thing, but in a way
that looks like regular step by step code.
0:18
If promises are like saying,
when this finishes, then do this,
0:24
async await is like saying, pause
until this finishes, then continue.
0:27
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