Created
November 13, 2018 11:44
-
-
Save gisderdube/c0f2bf251d04744189ae53e73c5a7f57 to your computer and use it in GitHub Desktop.
Basic try ... catch
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
const a = 5 | |
try { | |
console.log(b) // b is not defined, so throws an error | |
} catch (err) { | |
console.error(err) // will log the error with the error stack | |
} | |
console.log(a) // still gets executed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment