...

/

Handling the Fulfilled or Rejected States

Handling the Fulfilled or Rejected States

'then', 'onFulfilled' and 'onRejected' methods

Promises can be passed around as values, as function arguments, and as return values. Values and reasons for rejection can be handled by handlers inside the then method of the promise.

promise.then( onFulfilled, onRejected );
  • then may be called more than once to register multiple callbacks.
...