JavaScript · Middle · Question 23 of 75
What does a promise's .finally() do?
- ✓Correct answer: Runs on any outcome and doesn't change the chain's result
- 2Runs only on success and replaces the promise's value
- 3Cancels the promise if it's still in the
pendingstate
Explanation
finally receives no arguments and passes the value or error through unchanged - handy for hiding a loading indicator. Exception: if the callback itself throws or returns a rejected promise, the chain rejects.