Systematic debugging: reproduce, isolate, inspect state, fix, regression test.
Tools
- Breakpoints in Sources panel
debugger;statement pauses when DevTools open- Network tab for failed fetch
- Linters (ESLint) catch bugs early
console.assert
Fails loudly in DevTools when condition false—great in development builds.
Important interview questions and answers
- Q: Rubber duck?
A: Explain code line-by-line—often reveals assumption bugs. - Q: Binary search debug?
A: Comment half the code to find failing region.
Self-check
- First step when bug reported?
- Name two browser DevTools panels.
Tip: Re-run the playground code for debugging-techniques and tweak one line before the MCQs.
Interview prep
- Breakpoint?
Pause execution and inspect locals in DevTools.