July 16, 2019 03:09 pm GMT
Original Link: https://css-tricks.com/finally-a-post-on-finally-in-promises/
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:
Tweet
View Full Article