Hi there! In that example, all functions (myAsyncFunction, myAsyncFunction2 and myAsyncFunction3), are async, which means that they return promises. So what const firtsOperation is storing is the promise returned by myAsyncFunction.
Finally, by awaiting Promise.all we're waiting for all promises to resolve.
If I wanted firstOperation to contain myAsyncFunction final result I should have wrote const firstOperation = await myAsyncFunction();
But the idea of that example was to illustrate how we can execute many async functions in parallel.
Hi there! In that example, all functions (
myAsyncFunction
,myAsyncFunction2
andmyAsyncFunction3
), are async, which means that they return promises. So whatconst firtsOperation
is storing is the promise returned bymyAsyncFunction
.Finally, by awaiting
Promise.all
we're waiting for all promises to resolve.If I wanted
firstOperation
to containmyAsyncFunction
final result I should have wroteconst firstOperation = await myAsyncFunction();
But the idea of that example was to illustrate how we can execute many async functions in parallel.
More info: MDN - Promise.all()