Promises

Would you like to

try our new product?

You've just won $100 dollars. Call us!

Pending

Title Text

Fullfilled

You have a choice

Promises

  • Allow us to wait on other code to finish execution before running the next piece of code
  • Give us the ability to think sequentially about code.

Promise has 3 states

a.Pending — Asynchronous operation has not completed yet

b.Fulfilled — Operation has completed and the Promise has a value

c.Rejected — Operation has completed with an error or failed.

Promises

By JD Richards