Promise states and lifecycle
Every promise starts pending and eventually settles as fulfilled or rejected.
While a promise is pending, there is still no final value to work with. Once it settles, the result will never change again.
A reliable asynchronous design always accounts for both paths: the useful value and the possible failure.