Created
July 15, 2020 14:33
-
-
Save rkaw92/0f5144d24dc0bbde702e80d0f98a9ca0 to your computer and use it in GitHub Desktop.
You understand JS exceptions... or do you?
This file contains 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
function try1() { | |
try { | |
return 1; | |
} catch (error) { | |
} finally { | |
console.log('try1(): in finally{}'); | |
} | |
} | |
function try2() { | |
try { | |
return 1; | |
} catch (error) { | |
} finally { | |
console.log('try2(): in finally{}'); | |
return 2; | |
} | |
} | |
console.log('try1():', try1()); | |
console.log('try2():', try2()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment