Domanda di colloquio di Gainsight

What are promises in Javascript?

Risposta di colloquio

Anonimo

11 ago 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