# Console methods and breakpoints

*JavaScript Developer Study Guide · Debugging and Error Handling · Last updated October 16, 2026 · https://www.certifyforce.com/study-guide/javascript-developer/debugging-and-error-handling/console-methods-and-breakpoints*

Which console method answers which debugging question (table, dir, group, count, time and timeEnd, assert, trace), why a logged object can show later values, and how line, conditional and logpoint breakpoints, the debugger statement, stepping, the Scope and Call Stack panes, and pause-on-exception settings help you inspect running code.

- Certification: Salesforce JavaScript Developer
- Exam section: Debugging and Error Handling
- Study guide: https://www.certifyforce.com/study-guide/javascript-developer

**Official exam objective:**

> Given code to be debugged, use the console and breakpoints.

## What the exam expects

- Choose the `console` method for the job: `table`, `dir`, `group`, `count`/`countReset`, `time`/`timeLog`/`timeEnd`, `assert`, `trace`, and the log levels.
- Predict console output, including why an expanded object can show values assigned after it was logged.
- Pause code with a line breakpoint, a conditional breakpoint or a `debugger` statement, or log without pausing with a logpoint.
- While paused, step over, into and out, and read the Scope and Call Stack panes; pause on caught or uncaught exceptions.
- Key terms: **log level** (log, info, warn, error, debug: how the console classifies and filters a message); **label** (the string that names a counter or timer); **conditional breakpoint** (pauses only when an expression is true); **logpoint** (logs a message each time a line runs, without pausing); **call stack** (the chain of calls that led to the current line).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| `console.table()` | Displays tabular data as a table | [console.table()](https://developer.mozilla.org/en-US/docs/Web/API/console/table_static) |
| `console.dir()` | Interactive property listing with disclosure triangles | [console](https://developer.mozilla.org/en-US/docs/Web/API/console) |
| `console.count()` | Counts per label; no label means `"default"` | [console.count()](https://developer.mozilla.org/en-US/docs/Web/API/console/count_static) |
| `console.timeEnd()` | Stops the named timer and logs elapsed ms | [console](https://developer.mozilla.org/en-US/docs/Web/API/console) |
| `console.timeLog()` | Logs the timer's value; timer keeps running | [console](https://developer.mozilla.org/en-US/docs/Web/API/console) |
| `console.assert()` | Logs only when false; never throws | [console.assert()](https://developer.mozilla.org/en-US/docs/Web/API/console/assert_static) |
| `console.trace()` | Outputs a stack trace without pausing | [console.trace()](https://developer.mozilla.org/en-US/docs/Web/API/console/trace_static) |
| Logged objects | Browser shows contents when first viewed, not when logged | [console](https://developer.mozilla.org/en-US/docs/Web/API/console) |
| `debugger;` | Acts as a breakpoint only if debugging is available | [debugger](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger) |
| Paused debugger panes | Watch expressions, Call stack, Scopes | [What are browser developer tools?](https://developer.mozilla.org/en-US/docs/Learn_web_development/Howto/Tools_and_setup/What_are_browser_developer_tools) |

## Check yourself

- Why can an expanded object in the browser console show values assigned after the `console.log` call?
- When does a `debugger;` statement do nothing?
- Which method logs once per call with a running count per label?
- Why is `console.table()` better than `console.log()` for an array of 40 orders?

## Sources

- [console](https://developer.mozilla.org/en-US/docs/Web/API/console)
- [What are browser developer tools?](https://developer.mozilla.org/en-US/docs/Learn_web_development/Howto/Tools_and_setup/What_are_browser_developer_tools)
- [What went wrong? Troubleshooting JavaScript](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Scripting/What_went_wrong)
- [console: count() static method](https://developer.mozilla.org/en-US/docs/Web/API/console/count_static)
- [console: assert() static method](https://developer.mozilla.org/en-US/docs/Web/API/console/assert_static)
- [console: trace() static method](https://developer.mozilla.org/en-US/docs/Web/API/console/trace_static)
- [console: table() static method](https://developer.mozilla.org/en-US/docs/Web/API/console/table_static)
- [debugger](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 10 linked practice questions, and unlimited timed mock exams are included with the JavaScript Developer pack (USD $19): https://www.certifyforce.com/practice-exams
