Promise.finally() Run on completion
Last updated: 2026-09-09
Promise.finally() Run on completion
finally registers a callback that runs when the Promise settles (either way).
| Category | Async |
|---|---|
| ES version | ES2018 |
📝 Syntax
promise.finally(() => { ... });
⚙️ Parameters
| callback | A callback with no arguments. |
|---|
Returns:A new Promise (passes through the previous result).
Mutates the original:No (returns a new value)
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
(loading is false)
💡 Tip finally passes through the previous result unchanged.
ℹ️ info finally's callback receives no arguments.
🌐 Browser support
| Browser | |||||
|---|---|---|---|---|---|
| Promise.finally() | ✓ v58 | ✓ v79 | ✓ v48 | ✓ v10 | ✓ v45 |
| Supported by all modern browsers | |||||
🏷️ Related Items
💡 Related Cases
More case studies coming soon — check back later.
📚 Related Tutorials
❓ FAQ
Qfinally vs then/catch?
Afinally runs regardless of outcome; then/catch only for their state.
QCan finally change the result?
ANo — finally's return is ignored.
QWhen to use finally?
AClose loading, disconnect, cleanup — regardless of outcome.