-
-
Save tikarammardi/7ff1bba413b045d73742f5da55ae4026 to your computer and use it in GitHub Desktop.
create, throw, and handle the error
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
// main | |
function main(){ | |
try{ | |
if(conditon){ | |
throw new Error('We have error here, bye bye , see you in catch block'); | |
} | |
// this part of code it won't reach | |
}catch(e){ | |
console.log('Error is :', e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment