
Promise.finally() – `finally()` runs regardless of promise success or failure. Useful for cleanup tasks like hiding loaders.
๐ Syntax
promise.finally(() => {
// cleanup or final step
});
๐งช Example
fetch('/some-api')
.finally(() => console.log('Done loading'));
Comments
Post a Comment