1) Syntax errors: A Syntax error refers to simple errors in code such as missing parenthesis etc.
3) Logical errors: This errors is related to the logic, our program will compile and run but it will not give the correct output, as it must give. This type of errors are most difficult to find.
How to turn on the error message in the Browser:
By default Internet explorer shows an error icon in the status bar if any error occurs or we can turn on this option from browser.
To enable this option in Internet explorer, Tools >> Internet Option>> Select Advance Tab
We can check this checkbox to enable the error message notification.
Error Message in Mozilla Firefox:
We can view the console, select Tools>Web Developer>Error_Console.
These browsers give no indication when an error occurs; we have to keep the console open to view where error has occurred.
This is a console window which contains all the errors which are encountered during execution of script.
The error Notifications which shows up contains syntax errors as well as runtime errors.
How to Add Debugging code to our program:
We can manually insert alert() or document.write method to debug our code so that we can see the order of execution of our code and can examine where the errors appear.