A command line visual with high level interpretation of Javascript promise.
A command line visual with high level interpretation of Javascript promise.
A command line visual with high level interpretation of JavaScript promise.

Introduction

Before promises, in order to handle asynchronous requests callback function were used. But there are limitations with callbacks. Promises overcomes those limitations.

So let’s understand promises in JavaScript.

What is a Promise in JavaScript?

A promise is an object which handles asynchronous requests. When the implementation is correct, it will always promise that you will get a single response (either success or error) in the future. With the help of promise, you can manage asynchronous requests in a clean way as compare to callback functions.

Promise can be in any of the three states. These states are Pending, Fulfilled or Rejected. Through its entire life-cycle it can be in only two states, first will be Pending state and second will be either Fulfill or Reject state. …

About

Fraddy Oliveira

Web Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store