Chapter 9 of 10All chapters
Chapter 9 of 10
Debuggers and tools
Beyond printing values.
Using a debugger
A breakpoint pauses execution so you can inspect every variable and step line by line. Conditional breakpoints stop only when a value matches, which finds the one bad iteration in a million.
- Print statements are fine and fast; a debugger is better once the state is complex.
- The browser and most editors have one built in already.
Other instruments
A profiler shows where time goes, a memory tool shows what is not being freed, and the network tab shows what was actually sent. Each answers a question guessing cannot.