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
Learn what promises are, why they’re useful, and how they make asynchronous code cleaner. Practice creating, chaining, and handling promises.
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
something extremely important
in modern JavaScript, promises.
0:00
Fetch is completely built on promises,
so let's break this down.
0:03
A promise is an object
that represents a value
0:07
that will be available
sometime in the future.
0:10
It's a promise
that it'll be something else soon.
0:13
Up until promises,
the traditional way of handling
0:16
asynchronous code in
JavaScript was using callbacks.
0:19
Callbacks work,
but they can get messy quickly, especially
0:23
when you have multiple asynchronous steps
depending on each other.
0:26
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