Since the Promises were added in JavaScript, one of the biggest concerns was the absence of an ability to easily apply some code after the Promise is fulfilled (after both success and reject actions). There are many examples of such a need: showing a loader when the request to the server is in flight or even a simpler case- when we just want to log the completion of the operation regardless of how it finished.
Previously we had to include the function in both “on-success” and “on-reject” sections,
which resulted in the code overhead and clearly showed the need of something like other libraries have,
so meet the Promise.prototype.finally
!