How do you create an already-fulfilled or already-rejected promise in JavaScript?
Use Promise.resolve(value) for an already-fulfilled promise. Use Promise.reject(reason) for an already-rejected promise. These are settled immediately. .then/.catch still run (as microtasks).
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Promise States: Pending, Fulfilled, Rejected in JavaScript
Pending (initial, waiting for the operation to complete), fulfilled (operation succeeded, resolve was called), and rejected (operation failed, reject was called). A promise transitions from pending to fulfilled or rejected once.
No. A promise can only transition once: from pending to fulfilled or from pending to rejected. Once settled, it cannot change state. Subsequent resolve/reject calls are ignored.
No. There is no promise.state property. You can only react to settlement via .then, .catch, and .finally. If you need to track state, do it yourself by attaching .then and .catch handlers that update a variable.
Still have questions?
Browse all our FAQs or reach out to our support team
