Async and await

Inside a javascript async function, when is the right time to put await? I’m not to sure how to distinguish regular or await function when writing in async

when something returns a promise, and you need to use the value to which it resolves, you need to wait until it resolves to use that value - you put await to say “wait until the promise resolve”

Okay this cleared things up a lot. Thanks Ilenia!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.