mirror of
https://github.com/xfarrow/javascript-tutorials.git
synced 2025-04-23 14:57:34 +02: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:
|
// The result will be:
|
||||||
// Start, Before Await, End, After await
|
// Start, Before Await, End, After await
|
||||||
// "End" comes before "After Await" because the
|
// "End" comes before "After Await" because the
|
||||||
// flow of execution goes to the caller
|
// flow of execution goes to the caller of exampleAsyncFunction
|
||||||
// when await is invoked.
|
// 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
|
// Questions
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user