Created
May 10, 2017 09:34
-
-
Save gskachkov/880ef7983e8f20dd5e73a97d55ce794b to your computer and use it in GitHub Desktop.
Order of async function execution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const foo = async function () { | |
console.log('before await'); | |
const value = await 'boo'; | |
console.log('after await'); | |
return value; | |
}; | |
console.log('before async invocation'); | |
foo(); | |
console.log('after async invocation'); | |
// Output | |
// before async invocation | |
// before await | |
// after async invocation | |
// after await |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment