In the code, it was waiting for all the promise to be completed by await keyword. My question is, why the console statement got executed printing weatherData as promise pending?
Async functions always return a promise, regardless of what's inside them. The lifecycle of a promise goes from pending to settled (either fulfilled or rejected).
The "promise pending" message occurs because the promise has not yet completed its operation.
In the code, it was waiting for all the promise to be completed by await keyword. My question is, why the console statement got executed printing weatherData as promise pending?
Async functions always return a promise, regardless of what's inside them. The lifecycle of a promise goes from pending to settled (either fulfilled or rejected).
The "promise pending" message occurs because the promise has not yet completed its operation.
I also get hung up on multiple promises. This is a great overview and explanation ⭐️. Thanks for. you great work!