Promise Chains with the finally() Method

Discover how the finally() method is used in promise chains.

Using finally() in promise chains

The finally() method behaves differently than both then() and catch() in that it copies the state and value of the previous promise into its returned promise. That means if the original promise is fulfilled with a value, then finally() returns a promise that is fulfilled with the same value. For example, we have the following:

Get hands-on with 1400+ tech skills courses.