A Promise is an object representing a value that may not be available yet — the eventual result of an asynchronous operation. It has three states:
- pending — initial, not settled yet.
- fulfilled — completed successfully (has a value).
- rejected — failed (has a reason/error).
Once it settles (fulfilled or rejected) it's immutable — it can't change again.
js
()
.( res.())
.( (user))
.( (err))
.( ());
