Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 16, 2019 03:09 pm GMT

Finally A Post on Finally in Promises

When does finally fire in a JavaScript promise? This is a question I was asked in a recent workshop and I thought Id write up a little post to clear up any confusion.

The answer is, to quote Snape:

...always.

The basic structure is like this:

try {  // Ill try to execute some code for you}catch(error) {  // Ill handle any errors in that process} finally {  // Ill fire either way}

Take, for instance, … Read article

The post Finally… A Post on Finally in Promises appeared first on CSS-Tricks.


Original Link: https://css-tricks.com/finally-a-post-on-finally-in-promises/

Share this article:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks