DEV Community

Discussion on: Promise.race vs. Promise.any And Promise.all vs. Promise.allSettled

Collapse
 
bingocaller profile image
Jesper N. Jakobsen

Great article! I wasn't even aware of the new Promise features but you did a good job of explaining them.
Also, it looks like you need to swap line 2 and 3 in your Promise.any example output gist so they correspond to the example order. :)

Collapse
 
mayassalman profile image
mayas salman

I think that they correspond to the example order....
It is because of setTimeout(....

Collapse
 
bingocaller profile image
Jesper N. Jakobsen

I agree that they correspond to what output you would get from the code (because of setTimeout()), but I don't agree that they correspond to the example order.
Maybe what I should have said was that to make the example and output more readable, one would swap example 2 and 3. That way the output Gist corresponds to the example order and the actual output of the code.

Thread Thread
 
dance2die profile image
Sung M. Kim • Edited

Thanks Jesper for the suggestion.
I've updated the "output" with comments.

The reason I left the order as it was because I initially expected people to "copy/paste" the code and see the result.
(as opposed to copy/paste each example one at a time)

updated

Behold the power of Gist, now all my x-posts are updated too 😀

I will take notes of your suggestion when I post any types of examples next time.