Promise.finally()
Syntax
Return Value
A new Promise instance that will once again resolve or reject after executing the finally-callback.
Description
Makes it possible to execute code when Promise is resolved or rejected. Like the catch() and then() methods, this method will also return a new Promise instance. The difference is that the finally() method will not affect the state - the returned Promise will resolve or reject the same way as the original Promise. However, if an error occur in the finally() callback, then the returned Promise will reject with the exception thrown.