Glossary Term
Promise.prototype.finally()
The finally() method of Promise instances schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns another Promise object, allowing you to chain calls to other promise methods.
Like the finally block, this method is usually intended for cleanup actions, regardless of the promise’s outcome. It lets you avoid duplicating code in both the promise’s then() and catch() handlers.
The finally() method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome.
The finally() method is very similar to calling then(onFinally, onFinally). However, there are a couple of differences:
Syntax example: promiseInstance.finally(onFinally)
Term Connections
Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.
Loading term connections…
