DEV Community

Cover image for What does Javascript Promise us for 2020?

What does Javascript Promise us for 2020?

Gábor Soós on November 03, 2019

Promises are available since ES2015 to simplify the handling of asynchronous operations. Promises have two well-known combinators: all and race. Bo...
Collapse
 
maciek134 profile image
Maciej Sopyło

I don't really understand what is the use of try since throwing in a promise was already handled:

new Promise((resolve) => throw new Error('err'));

Would reject like any other promise. I do like the other ones though ;p

Collapse
 
sonicoder profile image
Gábor Soós

At entry scripts where you start synchronous, it can help.

Collapse
 
rohansawant profile image
Rohan Sawant

What does Javascript Promise us for 2020?

Ha! I see what you did there. ♥

Collapse
 
sonicoder profile image
Gábor Soós

Pun intended :)

Collapse
 
petecapecod profile image
Peter Cruckshank

Thanks that was a great read! 🤩👍

Collapse
 
sonicoder profile image
Gábor Soós

Thanks!