![]() |
VOOZH | about |
The finally() method of the Promise object is used to return a callback when a Promise is settled (either fulfilled or rejected).
task.finally(onFinally() {
});This method has a single parameter as mentioned above and described below:
It returns a Promise whose finally handler is set to the specified function.
Example: The below example demonstrates the finally() method:
Output:
Error: Promise has been rejected!
This is finally() block that is executed after Promise is settled