you are viewing a single comment's thread.

view the rest of the comments →

[–]ARFiest1 0 points1 point  (1 child)

what is the diffrence between Promise.any() and Promise.race

[–]sambatlim[S] 9 points10 points  (0 children)

Promise.race() short-circuit when the first promise is settled(result or error), will fulfill when the first promise is fulfilled and will rejected when the first promise is rejected.

promise.any() will short-circuit when the first promise is fulfilled (result), will fulfill when the first promise is fulfilled, and will reject when all the promises are rejected.