Last active
August 18, 2019 15:34
-
-
Save afaquejam/a315ec68520a267c2238ef541aaf5c6a to your computer and use it in GitHub Desktop.
Javascript Error Handling
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
let myName = undefined; | |
try { | |
if (myName === undefined) | |
throw Error('Name not defined!'); | |
} catch (error) { | |
console.log( | |
`Error name is ${error.name} & the error message is ${error.message}` | |
); | |
} finally { | |
myName = 'Whadup'; | |
} | |
console.log(`My name is ${myName}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment