Skip to content
uencoder

Promise

A Promise is a placeholder object for the eventual result of an asynchronous operation, with three states — pending/fulfilled/rejected — and supports chaining.

Purpose

Manage asynchronous results, avoid callback hell, and enable composable asynchronous programming.

Mechanism

States: pending → fulfilled (resolve) or rejected (reject). then registers success callbacks; catch registers failure callbacks. Chained then serializes async steps. Promise.all/allSettled/race compose in parallel.

Use cases

  • Asynchronous programming
  • API calls
  • Parallel control

Related terms

References