DEV Community

Discussion on: Why (We) Make Room For `console.log`?

Collapse
 
grumpytechdude profile image
Alex Sinclair

I really like this!
That said - when is this more useful than just running a debugger? I'd like to understand, but I'm currently failing to.

Collapse
 
samuelneff profile image
Samuel Neff

Running a debugger requires setting a breakpoint and inspecting the value. It's a lot more of a commitment when just adding a console statement is simpler for many situations. This is especially true when doing something like debugging a statement that might get hit a few dozen times with different args and you don't know which combination of args causes the wrong output. Debugging and inspecting each invocation will take a lot more time than logging the details. Once the details are identified, then you can set a conditional breakpoint if you still need more info.