The best practice to find out the error is to debug the code. The code can be debugged easily by using web browsers like Google Chrome, Mozilla Firebox.
Here, we will find out errors using built-in web browser debugger. To perform debugging, we can use any of the following approaches:
Using console.log() method
The console.log() method displays the result in the console of the browser. If there is any mistake in the code, it generates the error message.
Let's see the simple example to print the result on console.
To open the console on browser, press F12 key.
Using debugger keyword
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week