JS Promises

A Promise is an object representing the eventual completion or failure of an asychronous operation. 

Essentially, a promise is a returned object to which you attach callbacks, instead of passing the callbacks to the function

 

let promise = doSomethingAwesome(); promise.then(successCallback, FailureCallback);

or a cleaner way 

doSomethingAwesome().then(successCallback, failureCallback);