Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 1.03 KB

README.md

File metadata and controls

37 lines (24 loc) · 1.03 KB

49. Debugging strategies

Trace symptoms to causes with evidence.

Learn

  • stack traces
  • breakpoints
  • network panel
  • minimal reproduction

How it works

Read the first relevant error and follow its stack to the failing line. Inspect actual values, network responses, and DOM state. Reduce the problem to a small reproduction before changing several things at once. Fix the root cause, then verify the original scenario and nearby cases.

Common mistake

A console error after a previous error may be a consequence rather than the first cause.

Guided challenge

Debug a deliberately broken selector or data conversion and write down the cause and fix.

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.