Represent eventual success or failure.
- Promise
- then
- catch
- finally
- Promise.all
A promise settles once as fulfilled or rejected. then transforms its successful value and returns another promise; catch handles rejection. Promise.all combines independent operations and rejects when one fails. Always return a promise from a callback when a chain should wait for it.
Ignoring a rejected promise can produce an unhandled rejection and missing UI feedback.
Combine two delayed values and show success and failure paths.
Open example.html in a browser and edit example.js. Save, refresh, and use the Console and debugger to inspect values.
- Explain the core idea in your own words without reading the code.
- Change one input and predict the output before running it.
- Test one boundary or failure case, then record what you changed.