03 / 17

Explain the three states of a Promise.

pending, fulfilled and rejected are three states of a promise.

  1. 1

    Pending: The initial state, when the Promise is neither fulfilled nor rejected.

  2. 2

    Fulfilled: The state when the asynchronous operation completes successfully.

  3. 3

    Rejected: The state when the asynchronous operation encounters an error.