From 04ab3177d2b0004645c188f5cdba90cd26399bb4 Mon Sep 17 00:00:00 2001 From: xfarrow <49845537+xfarrow@users.noreply.github.com> Date: Wed, 8 Jan 2025 13:01:01 +0100 Subject: [PATCH] Update 3_async-await.js --- asynchronous_programming/3_async-await.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/asynchronous_programming/3_async-await.js b/asynchronous_programming/3_async-await.js index 8e88ff8..c105a01 100644 --- a/asynchronous_programming/3_async-await.js +++ b/asynchronous_programming/3_async-await.js @@ -41,8 +41,10 @@ console.log('End') // The result will be: // Start, Before Await, End, After await // "End" comes before "After Await" because the -// flow of execution goes to the caller -// when await is invoked. +// flow of execution goes to the caller of exampleAsyncFunction +// because "setTimeout(() => resolve('done'), 500)" gets enqueued in +// the Event Loop Thread and "console.log('After await')" can be executed +// only when the promise has resolved. // Questions //