How do you debug JavaScript in the browser developer tools?
The tools in the sources panel are the core of it. A breakpoint pauses execution and lets you inspect the state at that line. You set one by clicking the line number in the source view, and you can drag a breakpoint to a different line without setting it again.
Conditional breakpoints are the feature that makes the tool practical for large code bases. Instead of pausing on every iteration, you give the breakpoint a condition, and it only pauses when the condition is true. For a bug that only happens on one item in a long list, that is the difference between a two minute fix and an hour of clicking.
The step controls are the other half. Step over runs the next line without entering a function, step into enters the function that is about to run, and step out leaves the current function. Step over is the one you use most, because it is the one that keeps you at the level of code you care about.
Two more that matter. The watch panel evaluates expressions in the context of the paused frame, so you can inspect a variable or call a function on the current state without changing the code. And the call stack pane shows how you got to where you are, which is how you find the code that is calling something you thought nobody called.
For JavaScript specifically, the debugger statement pauses execution and opens the sources panel if it is not already open. Putting it in the source lets you reload and have the debugger waiting at exactly that line, which beats hunting for the right file by hand.