Overview
When programming a Javascript script, you will often need to debug your code. This is easily accomplished using the browsers debugging tools.To create a breakpoint, enter a debugger statement in your code, as follows.
debugger;
Next, open the broswers debugger, either through using the broswers menus to open the debugger, or by clicking ctrl-shift-i (works in most popular browsers)
Then, run your code. The code execution will stop at the debug statements in your code.