Then method
The JavaScript Promise then method registers fulfillment and rejection handlers and returns a new promise that represents their results.
Functional Programming in JavaScript
A Promise method that registers callbacks to run when the promise settles and returns a new promise for chaining.
- How it is used
- Structures dependent asynchronous work as linear transformations over values that arrive in the future.
- How deep it goes
- Explains callback arguments, serial chaining, and error placement, then extends the pattern to Promise.all.
- Examples
- Uses delayed resolution, promisified getJSON requests, chained student data processing, and concurrent grade retrieval.
- What you can do after
- Apply it via JavaScript Promise APIs to chain transformations, sequence requests, and handle failures.
Read how Functional Programming in JavaScript explains then method →
The Joy of JavaScript
A Promise method used to register fulfillment and rejection handlers and compose promise-based workflows.
- How it is used
- Uses Promise reactions to compose linear asynchronous transformations and centralize downstream error handling.
- How deep it goes
- Explains returned promises, value propagation, automatic flattening, broken chains, nested chains, and error recovery.
- Examples
- Demonstrates string transformations, fully linked and broken chains, nested promises, error propagation, and default-value recovery.
- What you can do after
- Apply it to build composable Promise pipelines, join nested asynchronous work, and diagnose detached handlers or unhandled rejections.
D3.js in Action, Third Edition
then() is a Promise method that registers callbacks for handling an asynchronous operation's fulfillment or rejection.
- How it is used
- Coordinates asynchronous D3 data loading with measurement, reorganization, and visualization construction.
- How deep it goes
- Explains Promise timing and callback access through a D3 workflow, stopping short of broader Promise behavior.
- Examples
- Uses a 33-row technology dataset, numeric count conversion, summary statistics, descending sorting, and a bar-chart handoff.
- What you can do after
- Apply it via JavaScript and D3 to manipulate a complete external dataset after loading finishes.
Read how D3.js in Action, Third Edition explains then method →
Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond
A Promise method that registers callbacks to run when the promise is fulfilled or rejected, returning a new promise for chaining.
- How it is used
- Registers callbacks for eventual values from promise-based requests, allowing data loading and its use to happen at different times.
- How deep it goes
- Walks through fulfillment timing and an optional rejection callback; defers further error-handling techniques while identifying chaining in the advanced summary.
- Examples
- Uses an axios GitHub API request, an early-loading user view, a cached transaction, and a callback-to-promise JSON exercise.
- What you can do after
- Apply it via axios to consume responses, handle request errors, and use the same callback pattern for pending or resolved promises.
Secrets of the JavaScript Ninja, Second Edition
A Promise method that registers fulfillment and rejection handlers and returns a new promise for chaining.
- How it is used
- Registers fulfillment and rejection handlers and links dependent asynchronous steps into a promise chain.
- How deep it goes
- Explains handler behavior and returned-promise chaining through a multi-request example.
- Examples
- Uses a promise resolved with “Hattori” and chained JSON requests for ninja missions.
- What you can do after
- Apply promise chaining to sequence dependent JSON requests and route failures to catch.
Read how Secrets of the JavaScript Ninja, Second Edition explains then method →
Related concepts
- microtask queueuses · A microtask queue is an event-loop queue that holds pending microtasks for processing after the current synchronous execution and before subsequent task processing.
- promiseproduces · A JavaScript Promise is an object representing the eventual completion or failure of an asynchronous operation and its resulting value or reason.
- callbackuses · A callback is a function or other callable supplied to software for invocation later in response to a specified event, condition, or point in execution.
- Promise#catchequivalent to · Promise#catch is a JavaScript Promise method that registers a handler for rejection and returns a Promise for the handler's outcome.
- async/awaitalternative to · 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.
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.




