Promise.prototype.finally

Attaches a callback function that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

Syntax

finally(callback?)

Parameters

Return value

A Promise for the completion of the callback.