3 ms·
In all examples provided, unless you want to return them as separate promises, you must await at some point. My understanding is that calling await on a promise
by DangitBobby 6y ago
In all examples provided, unless you want to return them as separate promises, you must await at some point. My understanding is that calling await on a promise does not prevent other Promises from being fulfilled, it just pauses execution of the rest of the code block. For example, if you performed two web requests and then awaited a setTimeout for a few seconds, your two web request promises would likely already be resolved by the time you awaited them. Which would mean that the difference between
await fetch
await fetch
concat
and
fetch
fetch
concat await
is that the fetch can actually perform asynchronous web activity in the latter example.