Mr. Tono’s sate order is a promise: Mrs. Sari’s kitchen resolves, rejects or throws. How often can the ticket change, and when do .then, .catch, .finally run?…
Why it matters
Understanding "settles once, then frozen" and "reactions are always async" explains the most common bugs: code after .then running first, promises that "never change", spinners nobody turns off (that is .finally’s job), and Uncaught (in promise).
The key idea
Once settled, a promise is frozen; its reactions are always microtasks
Common mistakes
Assuming .then runs synchronously Always a microtask: code after .then(...) runs first, even when the promise is already fulfilled. Use await, or put what comes next inside the chain.
Forgetting .catch A rejection with no handler at the end of the chain = Uncaught (in promise). Attach a .catch (or try/catch in an async function), and remember: inside a timer callback, call reject, do not throw.
Try it in this playground
Watch the ticket move: pending → fulfilled Step until the kitchen calls resolve.
Burnt: catch and finally run, then is passed over Run the Burnt situation until .finally.
Call again after it settled: ignored A settled promise does not change, and raises no error.
The promise is fulfilled, yet synchronous code still goes first Pick 'at once': 'pesanan dicatat' prints before 'makan sate'.