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 Asynchronous Programming with JavaScript!
You have completed Asynchronous Programming with JavaScript!
Preview
You've learned how to create and consume a promise, as well as how to chain together a sequence of promises, and handle rejected promises. Now you're going to convert parts of the project from callbacks to 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
Now we're going to jump back into
our People in Space project and
0:00
convert parts of it from
callbacks to promises.
0:02
Open the file promises.js.
0:05
In this file,
0:08
you should see code that's very similar to
the code you wrote in the previous stage.
0:09
Remember, a promise is the eventual value
or result of an asynchronous operation.
0:13
So which part of the program is set
to execute at some point later,
0:20
once it has the data it needs?
0:24
Well, in the function getJSON,
the callback function assigned
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