JavaScript Statements Reference
With the debugger turned on, this code should stop executing before it executes the third line:
The debugger statement stops the execution of JavaScript, and calls (if available) the debugging function.
Using the debugger statement has the same function as setting a breakpoint in the code.
Normally, you activate debugging in your browser with the F12 key, and select "Console" in the debugger menu.
Note: If no debugging is available, the debugger statement has no effect.
For more information about debugging in JavaScript, and how to activate debugging if your browser does not support it, read our JavaScript Debugging Tutorial.
Statement | |||||
---|---|---|---|---|---|
debugger | Yes | Yes | Yes | Yes | Yes |
JavaScript Version: | 1.0 |
---|
JavaScript Tutorial: JavaScript Debugging