paint-brush
JavaScript Promises for Dummiesby@jecelynyeen
1,312 reads
1,312 reads

JavaScript Promises for Dummies

by Jecelyn YeenDecember 2nd, 2016
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

<a href="https://hackernoon.com/tagged/javascript" target="_blank"><strong>Javascript</strong></a><strong> Promises</strong> are not difficult. However, lots of people find it a little bit hard to understand at the beginning. Therefore, I would like to write down the way I understand <a href="https://hackernoon.com/tagged/promise" target="_blank">promise</a>, in a dummy way.
featured image - JavaScript Promises for Dummies
Jecelyn Yeen HackerNoon profile picture

Javascript Promises are not difficult. However, lots of people find it a little bit hard to understand at the beginning. Therefore, I would like to write down the way I understand promise, in a dummy way.

Understanding Promises

A Promise in short:

“Imagine you are a kid. Your mom promises you that she’ll get you a new phone next week.”

You don’t know if you will get that phone until next week. Your mom can either really buy you a brand new phone, or stand you up and withhold the phone if she is not happy :(.

That is a promise. A promise has 3 states. They are:

  1. Promise is pending: You don’t know if you will get that phone until next week.
  2. Promise is resolved: Your mom really buy you a brand new phone.
  3. Promise is rejected: You don’t get a new phone because your mom is not happy.

Full article available in my Scotch:


JavaScript Promises for Dummies_Get to know JavaScript Promises better. Javascript Promises are not difficult. However, lots of people find it a little…_scotch.io