mirror of
https://github.com/xfarrow/javascript-tutorials.git
synced 2025-02-05 11:37:31 +01:00
Update 3_async-await.js
This commit is contained in:
parent
374f29c955
commit
04ab3177d2
@ -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
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user