Why the return value of Promise.all () is ordered

promise.all () can wrap multiple promise and return a new promise instance. In principle, the request sent is still asynchronous, so why is the returned result ordered

?
Mar.20,2021

the order in which the results are returned is the order provided by promiseArr in your Promise.all (promiseArr).
the semantics of all is like this. If you want to trigger in the order in which a single request is returned, you can write two separate promise directly, or you can do without observable

.

if it helps you, please upvote or adopt it. If there is no help, please leave a message.

Menu