Promises

Added in ES 2015.
A promise is an object that represents the eventual result of an asynchronous operation.
This resolves the fundamental problem that callbacks have.
Promises allow us to string together multiple chained callbacks while making the code easier to read.
A promise is an object that represents the eventual result of an asynchronous operation.


It has a state property
It has a result property.
It has a resolve method.
It has a reject method.
A promise can only suceed or fail once





© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext