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. :)
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.
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)
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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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. :)
I think that they correspond to the example order....
It is because of setTimeout(....
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.
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)
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.