# Promise (JavaScript)

> An object for a result not ready yet. It ends in a value or an error.

**Field:** Software Development  
**Category:** Programming Paradigms  
**Also known as:** Promise, Future, Promises

## Think of it like

Think of it like a ticket at a coat check. It is not your coat yet, but you will get it back.

## Definition

A promise is an object that stands for a result that is not ready yet. It starts as pending, then ends as fulfilled with a value or rejected with an error. You attach what to do next with then, and what to do on failure with catch. Promises can be chained, so steps read in order instead of nesting. Other languages call the same idea a future.

## Example

Lucy's app calls fetch for a weather page. It gets a promise at once, and the forecast shows up when the promise is fulfilled.

## Example code

```javascript
Promise.resolve(5).then((n) => console.log(n * 2)); // 10
```

then runs once the promise has its value.

## Why it matters

Most modern JavaScript tools give back promises. async/await is built on top of them.

## Common mistake

Forgetting a catch. A rejected promise with no catch can fail without anyone seeing it.

## Three principles

- **A value to come.** Not ready yet.
- **Three states.** Pending, fulfilled, rejected.
- **Chain with then.** Steps read in order.

## Related terms

- [Async/Await](https://learn.benibix.com/term/development/async-await)
- [Callback Function](https://learn.benibix.com/term/development/callback)
- [Asynchronous Code](https://learn.benibix.com/term/development/asynchronous-code)
- [Event Loop](https://learn.benibix.com/term/development/event-loop)
- [Fetch API](https://learn.benibix.com/term/development/fetch-api)

## Told apart from

- [Callback vs Promise](https://learn.benibix.com/compare/callback-vs-promise): A callback is a function you hand over to be run later. A promise is an object for a result to come, which you can chain with then. Promises avoid deep nests of callbacks.
- [Promise vs Async/Await](https://learn.benibix.com/compare/promise-vs-async-await): People think async and await replace promises for good, and they do not. An async function still hands back a promise. The word await is a tidier way to wait for one, so the code reads from top to bottom. Under the hood it is the same promise. The then and catch calls just turn into plain lines inside a try and catch.

---

Source: https://learn.benibix.com/term/development/promise
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
