Easy Tutorial
❮ Prop Doc Lastmodified Met Console Groupend ❯

JavaScript debugger Statement

JavaScript Statements Reference

Example

Enable debugger, code stops execution before the third line.

var x = 15 * 5; debugger; document.getElementById("demo").innerHTML = x;

Definition and Usage

The debugger statement is used to stop the execution of JavaScript and call (if available) the debugging function.

Using the debugger statement is similar to setting a breakpoint in the code.

Typically, you can open the debugging tools by pressing F12 and select "Console" in the debugging menu.

Note: If debugging tools are not available, the debugger statement will not work.

For more information on JavaScript debugging and how to activate browser debugging tools in case of unsupported browsers, please refer to our JavaScript Debugging tutorial.


Browser Support

Statement
debugger Yes Yes Yes Yes Yes

Syntax

Technical Details

| JavaScript Version: | 1.0 | | --- | --- |


Related Pages

JavaScript Tutorial: JavaScript Debugging


❮ Prop Doc Lastmodified Met Console Groupend ❯