JavaScript Promise finally()
Description
The finally() method provides a callback.
The callback is a function to run when a promise is settled (fulfilled or rejected).
Syntax
promise.finally(settled())
Parameters
| Parameter | Description |
| settled() | Function to run when the promise is settled (fulfilled or rejected) |
Return Value
| Type | Description |
| Object | A new Promise Object |
Promise Methods
Static Methods
Promise.all()
Promise.allSettled()
Promise.any()
Promise.race()
Promise.reject()
Promise.resolve()
Promise.try()
Promise.withResolvers()
See Also:
Browser Support
finally() is a JavaScript 2018 feature.
ES 2018 is supported in all modern browsers since June 2020:
| Chrome 63 |
Edge 79 |
Firefox 78 |
Safari 12 |
Opera 50 |
| Des 2017 | Jan 2020 | Jun 2020 | Sep 2018 | Jan 2018 |