Pause execution with breakpoints and step controls
Quick answer
A breakpoint pauses a running program in an attached debugger so you can inspect variables and the call stack before continuing. It is not an ordinary logging call.
How it works
In Chrome DevTools Sources, set a line breakpoint on executable code, trigger the relevant action, inspect Scope and Call Stack, then resume. Step over advances without stepping into a called function, step into enters a call when available, and step out runs toward the caller. Conditional breakpoints pause only when their expression evaluates truthy. The debugger statement can request a pause if debugging facilities are available. Without an active debugger it has no observable debugging effect. Avoid side effects in breakpoint conditions.
Local examples
Run in Node.js v22.16.0 as a CommonJS script. No interactive debugger attached; actual ByteMind editor support is unverified.
(async () => {const total=3*4; debugger; console.log(total);})()Expected console output:
12The unattended Node run continues. Actual pause is tested separately with an attached protocol debugger.
Run in Node.js v22.16.0 as a CommonJS script. No interactive debugger attached; actual ByteMind editor support is unverified.
(async () => {const rows=[2,-1,0,-3];console.log(JSON.stringify(rows.map(qty=>qty<0)));})()Expected console output:
[false,true,false,true]Only negative quantities satisfy the condition.
Common mistakes
Do not interpret a successful console run as proof that DevTools paused. Pausing may alter timing; it is not a reliable performance measurement.
Practice
Open the standalone debugger lab, pause before the total calculation and compare the arguments to your expected values; step into the helper.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Pause execution with breakpoints and step controls — Knowledge Check
Apply the concept and reason about local example output.
Which step control normally enters the called function?
What does a conditional breakpoint use to decide whether to pause?
Does an unattended debugger statement prove an interactive pause occurred?
What is the exact console output in Pause execution with breakpoints and step controls example 1?
(async () => {const total=3*4; debugger; console.log(total);})()What is the exact console output in Pause execution with breakpoints and step controls example 2?
(async () => {const rows=[2,-1,0,-3];console.log(JSON.stringify(rows.map(qty=>qty<0)));})()