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

What is go Method of History Object in Javascript ?

What are Advantages of Using External Javascript ?

What are Different Javascript Frameworks ?

What is Difference Between Call and Apply Methods in Javascript ?

What is Code Smell in Javascript ?