Promises and async functions

Predict the order of the three log lines in the example.

Examples

Example 1

Input
Run showStatus() and the synchronous line that follows it.
Expected output
Requesting
Caller continues
Ready

Hints and solution

Hint 1

The first log inside the async function is above await.

Reveal worked answer

The initial call prints Requesting. The continuation is deferred at await, so the caller prints next. The awaited result prints last.

Back to the lesson