re: How to implement `Promise.all`? VIEW POST

FULL DISCUSSION
 

I just realized that only the first solution (using counters) works like the browser's Promise.all. The problem with the other solutions occurs when one of the individual promises -- not the first one -- rejects before the promises before it resolve. In this case, Promise.all will wait and only reject once all the other promises resolve. In addition, the browser will throw a UnhandledPromiseRejectionWarning.

Only the first solution will not wait to reject any individual promise.

 

this is true. thank you! it is a good shout!

code of conduct - report abuse