Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / JavaScript

debugger — debugging statement

The debugger; statement marks a place where an active debugger may pause program execution. Without a debugger present or active, it has no observable effect.

Version: ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support

Syntax

debugger;

debugger; is a JavaScript statement, not a function call or a Web API. It takes no arguments. debugger is a reserved word: it cannot be used as a variable or function name.

When a debugging facility is available and enabled, the statement triggers an implementation-defined action that may pause execution at that point. ECMAScript does not specify the debugger interface or guarantee a pause. Without a debugger present or active, the statement has no observable effect.

In the example, total is 60 before execution reaches debugger;. If execution pauses, you can inspect that value and then resume without changing program state. console.log(total) will then print 60. The debugger; statement itself prints nothing.

Remove unintended debugger; statements before publishing code because they may interrupt someone using an active debugger. Do not treat them as a way to stop execution in ordinary application logic.

Examples

const price = 20;
const quantity = 3;
const total = price * quantity;
debugger;
console.log(total);

Result

60

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources