3 Comments
User's avatar
Sazid's avatar

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?

Expand full comment
Practical Javascript's avatar

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.

Expand full comment
Earth to Bob's avatar

I also get hung up on multiple promises. This is a great overview and explanation ⭐️. Thanks for. you great work!

Expand full comment