Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 983 Bytes

File metadata and controls

36 lines (23 loc) · 983 Bytes

02. Console and developer tools

Use the console and debugger to observe program state.

Learn

  • console.log
  • breakpoints
  • step over
  • watch expressions

How it works

The console shows messages and errors. Breakpoints pause execution at a line so you can inspect variables, follow control flow, and test assumptions. Reproduce a problem before changing code.

Common mistake

Adding more code without reading the first error usually hides the cause.

Guided challenge

Set a breakpoint before a calculation, predict its result, step through it, and record the observed values.

Run the example

Open example.html in a browser and edit example.js. Save, refresh, and use the Console and debugger to inspect values.

Completion check

  • Explain the core idea in your own words without reading the code.
  • Change one input and predict the output before running it.
  • Test one boundary or failure case, then record what you changed.