TESTING & DEBUGGING / LESSON 07
Debugging Tools.
Master browser DevTools and IDE debugging features for efficient bug hunting

Loading the lesson…
Loading activities…
TESTING & DEBUGGING / LESSON 07
Master browser DevTools and IDE debugging features for efficient bug hunting

Loading the lesson…
Loading activities…
console.log is a solid place to start. Pros go further though, with tools that let you freeze your code mid-run, peek at every variable, and walk through the logic one line at a time. And the most important one is already sitting inside your browser (no download required).
Every modern browser (Chrome, Firefox, Edge, Safari) ships with Developer Tools. Open them with F12 or Cmd+Option+I on Mac. (Safari makes you switch on its developer menu in the settings first.) DevTools has a bunch of panels, and each one is built for a different kind of debugging.
These are the four panels that matter most for debugging.
Inspect and change HTML and CSS live. You see EXACTLY what the browser rendered, including computed styles and the box model.
Run JavaScript, read errors and logs, and mess with the page using code. It's your command center for quick experiments.
See every HTTP request your app makes, with the headers, response data, timing and status codes. You can't debug API problems without it.
Set breakpoints, step through code, inspect variables, and make sense of the call stack. This is the heavy hitter of the bunch.
Quick side note. Chrome's DevTools also has a Lighthouse panel that grades your page with a score. Handy, but don't get hypnotized by the number. I've got a client with an honestly abysmal PageSpeed score who still pulls in strong lead flow. Use these tools to fix real problems, not to chase a grade.
Head to the Elements panel when something just LOOKS wrong.
The Console does a lot more than show your console.log output. It's a full JavaScript playground.
When your app isn't loading data right, the Network panel shows you what's really going on.
Breakpoints are the big gun. They pause your code on a specific line so you can look at everything going on right at that moment.
There are a few flavors of breakpoint.
item.price > 100Once you're paused on a breakpoint, you can walk through your code one line at a time.
| Button | Action | What It Does |
|---|---|---|
| Resume | Continue | Run until the next breakpoint |
| Step Over | Next line | Execute the current line and move to the next |
| Step Into | Go deeper | If the line calls a function, jump inside it |
| Step Out | Go up | Finish the current function and return to the caller |
Watch expressions let you keep an eye on specific values while you step through code.
Every time you step to a new line, your watch expressions update by themselves. WAY faster than scattering console.log statements all over the place.
The call stack shows how your code ended up on the current line. Read it from the bottom up to follow the chain of function calls.
The call stack is how you answer the question "wait, how did my code even GET here?"
You've got some serious debugging tools in your belt now. In the last lesson of this module, we'll look at how Claude can speed up your whole testing and debugging routine by writing tests, explaining errors and suggesting fixes...