Suggest an editImprove this articleRefine the answer for “When is a promise considered "fulfilled"?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**A promise is considered "fulfilled"** when the asynchronous operation has completed successfully and the `resolve()` function has been called - that is, the promise now has a result (value). **Key point:** once a promise moves to `fulfilled` or `rejected`, its state becomes final (immutable).Shown above the full answer for quick recall.Answer (EN)Image## Short answer **A promise is considered "fulfilled"** when the asynchronous operation **has completed successfully** and the `resolve()` function has been called - that is, the promise now has a **result (value)**. --- ## Formally, in ECMAScript A `Promise` object has **three states**: | State | What it means | Can it change | |---|---|---| | `pending` | "waiting" - the result is not yet known | Yes | | `fulfilled` | "completed successfully" - `resolve()` was called | No | | `rejected` | "completed with an error" - `reject()` was called | No | After moving to `fulfilled` or `rejected` - the state becomes **final** (immutable). --- ## Example: a promise becomes "fulfilled" ```javascript const promise = new Promise((resolve, reject) => { setTimeout(() => { resolve('Data received'); }, 1000); }); promise.then((result) => { console.log(result); }); ``` After 1 second, `resolve('Data received')` is called -> the promise moves from `pending` -> to `fulfilled`, and `.then()` runs. --- ## When it is **not** considered fulfilled ### 1. As long as `resolve()` or `reject()` has not been called ```javascript new Promise(() => { // we call nothing }); // state: pending (forever) ``` ### 2. If the promise resolves with another promise (chaining) ```javascript const p = new Promise((resolve) => { resolve(fetch('/data')); // resolve returns another Promise }); ``` Then `p` **will not settle** until the **nested Promise** settles. (the "promise unwrapping" mechanism). --- ## Example with `reject` (an error) ```javascript const promise = new Promise((resolve, reject) => { reject('Network error'); }); promise .then(() => console.log('Success')) .catch((err) => console.error(err)); ``` The promise **is settled**, but in the `rejected` state, so `.catch()` runs. --- ## When `.then()` / `.catch()` run - `.then()` fires **only** if the promise becomes **fulfilled** - `.catch()` fires if it becomes **rejected** - `.finally()` fires in **any** case, once the promise settles --- ## Timing example ```javascript const p = new Promise((resolve) => { console.log('1 pending'); setTimeout(() => resolve('2 fulfilled'), 2000); }); p.then(console.log); console.log('3 continuing execution'); ``` Sequence: ```javascript 1 pending 3 continuing execution 2 fulfilled ``` The promise is "fulfilled" only after 2 seconds - at the moment `resolve()` is called. --- ## Summary: what "Promise fulfilled" means | State | What happened | Methods that fire | |---|---|---| | `pending` | operation in progress | none | | `fulfilled` | `resolve()` was called | `.then()`, `.finally()` | | `rejected` | `reject()` was called, or an error occurred | `.catch()`, `.finally()` | --- ## A simple analogy > A promise is like a delivery > > - While the order hasn't arrived -> `pending` > - The courier arrived with the package -> `fulfilled` > - The courier called: "address not found" -> `rejected` --- ## Conclusion **A Promise is considered "fulfilled"** when it moves from the `pending` state -> to one of the final ones: - `fulfilled` - successfully (`resolve(value)`) - `rejected` - with an error (`reject(reason)`) After that: - the state no longer **changes**, - and the result can be obtained via `.then()`, `.catch()`, or `await`.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.