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
If an error occurs, the promise status changes from "pending" to a "rejected" (or failed) state. Promises give you the opportunity to handle the error with a method called catch()
.
Running a JavaScript file with the node
command
If you are not able to run the file promises-breakfast.js
in your Terminal or console using the command node promises-breakfast.js
, you can link the file to index.html
and then test the output in your browser's console:
<body>
...
<script src="js/promises-breakfast.js"></script>
<script src="js/callbacks.js"></script>
</body>
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
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