My(Promise => To You)

Jaden Locke
3 min readOct 20, 2020
Photo by Sarah Cervantes on Unsplash

A promise can be:

  • Fulfilled, the action relating to the promise exceeded.
  • Rejected, the action relating to promise failed.
  • Pending, hasn’t been fulfilled or rejected yet.
  • Settled, has fulfilled or rejected

What exactly are Promises in JavaScript?

The promise object represents the eventual completion or failure of an operation and its returning/resulting value. Promises can be like event listeners but a promise can only succeed or fail once. So when you grab something with a promise you are not really worried about the time it became available, your just worried about the outcome and what you want to do with it.

Promises can be in libraries such as:

  • RSVP JS
  • Q
  • When

The libraries also share a behavior with Javascript promises which is Promises/A+. Promises/A+ is an open standard for sound, interoperable Javascript promises by implementors and also for implementors.

Here is a chart better explaining the above:

History of Promises.

Implementations of promises appeared in languages such as Multi Cisp and Concurrent prolog in the early 1980s. Also in the beginning of 2011 promise concepts were made popular by JQuery Defferred Objects. Deferred objects are similar to promises. In 2012 they were proposed to specs to standardize how many authors were using promises. They brought more attention for promises, one of the reasons they became so popular.

Photo by Kyle Glenn on Unsplash

Sources.

There is a possibility that you might get asked a question about promises maybe in a job interview or maybe in a simple conversation about Javascript. Javascript is used in many applications. There are way more to promises that I did not cover here are some links so you can take a deeper dive for yourself and get your toes wet in that big promise pool.

Conclusion

Javascript is a very powerful language that can be used for a lot of things in development. Promises are included as one of those strengths for Javascript out of many. So i would say promises are important especially if you plan on expanding your knowledge in Javascript. Also promises are pretty cool that can dynamically make your application better to look at and possibly with less code. So just promise me you will at least take a look.

--

--