Promise
A JavaScript Promise is an object representing the eventual completion or failure of an asynchronous operation and its resulting value or reason.
The Joy of JavaScript
- How it is used
- Models single asynchronous results as composable chains instead of nested callbacks.
- How deep it goes
- Works through construction, settlement, chaining, and nested-Promise flattening, while leaving detailed event-loop scheduling aside.
- Examples
- Uses Promise construction, chained string transformations, and a filesystem workflow that checks access, reads, counts, and catches errors.
- What you can do after
- Apply it via the JavaScript Promise API to compose asynchronous operations and handle their failures in a flat chain.
Secrets of the JavaScript Ninja, Second Edition
A JavaScript object representing the eventual completion or failure of an asynchronous operation and its resulting value.
- How it is used
- Organizes asynchronous browser work so dependent server requests need not block the UI or rely on nested callbacks.
- How deep it goes
- Works through construction, state transitions, rejection, and a promise-returning JSON request, then extends to chains and generator coordination.
- Examples
- Uses a delayed timer, explicit and exception-driven rejection, and an XMLHttpRequest-based JSON fetch.
- What you can do after
- Build it from scratch: wrap an XMLHttpRequest in a promise and handle successful responses, request failures, and invalid JSON.
Read how Secrets of the JavaScript Ninja, Second Edition explains promise →
Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond
- How it is used
- Uses promises to pass around eventual asynchronous results and handle them when needed.
- How deep it goes
- Works through consumption, errors, helpers, chains, and constructor-based wrappers; stops short of detailed event-loop internals.
- Examples
- Demonstrates GitHub organization requests, cached transactions, image loading, and a canvas fade.
- What you can do after
- Build it from scratch with new Promise, or apply it via axios and Promise helpers to coordinate asynchronous work.
Functional Programming in JavaScript
- How it is used
- Coordinates asynchronous operations while supporting composition, chaining, and centralized failure handling.
- How deep it goes
- Explains lifecycle, callbacks, chaining, concurrency, and practical wrappers, but stops short of detailed implementation internals.
- Examples
- Uses delayed callbacks, XMLHttpRequest, student records, browser storage, chained requests, and Promise.all().
- What you can do after
- Builds and composes asynchronous JavaScript operations with then, catch, and Promise.all().
Read how Functional Programming in JavaScript explains promise →
D3.js in Action, Third Edition
A JavaScript Promise is an object representing the eventual completion or failure of an asynchronous operation and its resulting value.
- How it is used
- Coordinates asynchronous D3 data loading with later measurement, reorganization, and visualization.
- How deep it goes
- Defines the returned object and demonstrates then() callbacks, but does not develop rejection handling or Promise internals.
- Examples
- Uses d3.csv(), row conversion, d3.autoType, console logging, sorting, and createViz() with technology and temperature datasets.
- What you can do after
- Apply it via D3 to wait for loaded data before measuring, sorting, transforming, or drawing a visualization.
API Design Patterns
A promise is an object or abstraction representing the eventual completion or failure of an asynchronous computation.
- How it is used
- Uses promises to represent asynchronous work without immediately blocking program execution.
- How deep it goes
- Explains resolution, rejection, awaiting, callbacks, polling, and waiting, but does not descend into promise implementation internals.
- Examples
- Demonstrates factorization, await, then/catch callbacks, and a chat-room operation tracked through an API.
- What you can do after
- Apply promises through await or callbacks, and evaluate API operations through polling or a wait method.
Rust Servers, Services, and Apps
A JavaScript promise is an object representing the eventual completion or rejection of an asynchronous operation and its resulting value.
- How it is used
- Uses promises to explain nonblocking browser requests and to compare JavaScript asynchronous processing with Rust async code.
- How deep it goes
- Defines promise semantics and contrasts them with futures, but stops short of JavaScript promise construction or chaining APIs.
- Examples
- Uses browser URL fetches and image loading as concrete asynchronous operations represented by promises.
- What you can do after
- Evaluate how JavaScript promises correspond to Rust futures while recognizing rejection as a higher-level promise behavior.
Read how Rust Servers, Services, and Apps explains promise →
Related concepts
- Promise.allused by · Promise.all is a JavaScript static method that returns a promise fulfilled with an array of results when all input promises fulfill, or rejected if any input promise rejects.
- Promise.raceused by · Promise.race is a JavaScript static method that returns a promise settled with the outcome of the first input promise or thenable to settle.
- async/awaitproduced by · Async/await is language syntax for expressing asynchronous computations that suspend at awaited operations and resume when they can proceed without blocking the execution thread.
- dynamic importproduced by · Dynamic import is a language feature that asynchronously loads a module at runtime and returns a promise for its module namespace.
- async iteratorused by · An async iterator is an iterator interface that asynchronously produces successive values for consumption over time.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.






