What is Promise?

A promise is like a special kind of note that tells you something will happen later, and it helps you keep track of when it does.

Imagine you're waiting for your favorite snack after school. You leave a note on the kitchen table that says, "I promise I'll eat my snack at 4:00 PM." That note is like a promise, it tells you something will happen (you'll get to eat your snack) and when (at 4:00 PM).

How a Promise Works

When you write the note, you're making a promise. The person who reads the note (maybe your mom or dad) knows what's coming next.

If you're using promises in computer land, it's like telling the computer, "I promise I'll give you this snack at 4:00 PM." Then, when the time comes, the computer can do something else, like play a game, and come back later to get your snack.

You don’t have to wait for the snack right then, you can keep playing while the promise is being kept. That’s how promises help computers work smoothly without getting stuck waiting for one thing after another.

Take the quiz →

Examples

  1. A promise is like a friend who says they'll bring you ice cream later, you don't have to wait right then, but you know it's coming.
  2. If you ask your friend for ice cream and they say 'I'll get it for you in five minutes,' that's a promise.
  3. Your friend might not always bring the ice cream, so promises can also fail.

Ask a question

See also

Discussion

Recent activity