Glossary · Phase 8 · APIs
Promise
A JavaScript value that stands for a result that isn't ready yet; it settles once, fulfilled with a value or rejected with an error.
A promise stands for a result that isn't ready yet. It starts pending, then becomes fulfilled with a value or rejected with an error, once, for good.
fetchreturns one, as does anything that waits.
Try it now
Step through one await. The page stays responsive in the middle, while the request is out.
Learn it properly
Async JavaScript: promises, await and fetch · The event loop, async and await, fetch with res.ok checks, Promise.all, and timeouts with AbortController. About 30 minutes.
Other terms from the same lesson
- AbortController: A JavaScript object whose signal is passed to fetch; calling abort() cancels the request, as a Stop button does.
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.