Home of web learners


javascript can work with exception handling

Lets look below example

     <title>Exception handling</title>
               var b = 5;
               try {
               catch ( e ) {

Here,we use try,catch to get error,in try block if there any error occur,then in catch block we can get the error by e.description,if we run this script,then we got error details,as in the code,we write code to show output for a variable,but a variable value is not defined,so we get the error occurred in the code


About webn3rd