What is Promise in Javascript ?

The Promise object represents the eventual completion (or failure) of an asynchronous operation along with its resulting value.

A Promise is a proxy for a value which may or may not be known when the promise is created.

It allows you to associate handlers with an asynchronous action's eventual success value or failure reason.

This enables asynchronous methods return values like synchronous methods: instead of immediately returning final value, the asynchronous method returns a promise to provide the value at some point in the future.



You May Interest

Javascript Removing Elements from Array

What is Alert Method in Window Object in Javascript ?

What is Console Object in Javascript ?

What is this Keyword in Javascript ?

What are Advantages of Javascript ?