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, Third Edition
A then method accepts fulfillment and rejection callbacks, allowing an object to participate in promise-like resolution.
- How it is used
- Composes promise-based operations into chains and centralizes error handling across them.
- How deep it goes
- Explains callback outcomes, returned-promise resolution, and microtask timing through worked examples.
- Examples
- Uses a fetch request with response validation, JSON parsing, catch, and finally, plus a timeout ordering demonstration.
- What you can do after
- Apply it to chain asynchronous operations and route failures to a shared catch handler.
Read how Secrets of the JavaScript Ninja, Third Edition explains then method →
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 →
What to know first
- exceptionAn exception is a runtime signal or value representing an abnormal condition that interrupts ordinary program flow and can be handled or propagated.
- try-catch blockA try-catch block is a control-flow construct that executes code under exception handling and transfers control to an associated handler when a matching exception occurs.
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 or registered with a component for invocation at 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 defining asynchronous computations that can suspend at awaited operations and resume when those operations produce results.
Questions about then method
What is then method?
The JavaScript Promise then method registers fulfillment and rejection handlers and returns a new promise that represents their results.
Which Manning books explain then method?
Functional Programming in JavaScript, The Joy of JavaScript, D3.js in Action, Third Edition, Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond, Secrets of the JavaScript Ninja, Third Edition and Secrets of the JavaScript Ninja, Second Edition.
What should I know before learning then method?
Manning books that teach then method usually introduce exception and try-catch block first.
What is the difference between then method and async/await?
The JavaScript Promise then method registers fulfillment and rejection handlers and returns a new promise that represents their results. Async/await is language syntax for defining asynchronous computations that can suspend at awaited operations and resume when those operations produce results.
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.





