debugger

Summary

Suspends execution and invokes the debugger. If a debugger is not available, this statement does nothing.

Syntax

debugger;

Description

The debugger statement suspends program execution and invokes the debugger. If no debugger is available, the statement does nothing and resumes to the next statement.

The usual behaviour in web browsers for the debugger statement is to set a breakpoint where the debugger statement appears.

Examples

Basic Usage
1
debugger;
Conditionally invoking the debugger
1
2
3
4
// Conditionally invoke the debugger
if (isTrue()) {
    debugger;
}

Share

HTML | BBCode | Direct Link