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
settled() | Function to run when the promise is settled (fulfilled or rejected) |
Return Value
Type | Description |
Object | A new Promise Object |
Browser Support
finally()
is an ECMAScript 2018 feature.
ES2017 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 |
finally()
is not supported in Internet Explorer.