Skip to content

Instantly share code, notes, and snippets.

@sorie
Last active July 1, 2021 08:38
Show Gist options
  • Save sorie/25ae00ead81411d8fd50d933851e29b5 to your computer and use it in GitHub Desktop.
Save sorie/25ae00ead81411d8fd50d933851e29b5 to your computer and use it in GitHub Desktop.
Check await order when trying/catch
(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