Gainsight interview question

What are promises in Javascript?

Interview Answer

Anonymous

11 Aug 2020

Promises are constructs in JS that make asynchronous programminng easier. Promises accept two callbacks as parameters, resolve and reject. If the promise is fulfilled, .then function is called to run the resolve function. If the promise is not resolved, reject() follows.

1