Promise States
A promise is a receipt for a future value — pending, then fulfilled or rejected.
Think of a promise like a kitchen receipt: you do not have the result yet, but you have proof the work was accepted. While waiting it is pending. Later it becomes fulfilled (success) or rejected (failure). No network here — only delayed local work (Phase 10 timers).
State
—
Value / error
(none yet)
Timeline
Press a button.
Important JavaScript
// A Promise has one of three states:
// pending → fulfilled (with a value)
// pending → rejected (with a reason)
const later = new Promise(function (resolve, reject) {
setTimeout(function () {
resolve("Scout report ready");
// or: reject(new Error("Timeout"));
}, 800);
});
// later is pending right now — the value arrives later.