Last active
July 1, 2021 08:38
-
-
Save sorie/25ae00ead81411d8fd50d933851e29b5 to your computer and use it in GitHub Desktop.
Check await order when trying/catch
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
(async () => { | |
try{ | |
await (() => { | |
console.log( 'try await'); | |
throw error; | |
console.log('after throw error'); | |
})(); | |
// throw error; | |
// await (() =>{console.info('after throw error')})(); | |
return '사과'; | |
}catch(error){ | |
await (()=> {console.error( 'error')})(); | |
return '독사과'; | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment