Using 'debugger' to help in javascript debugging
blog.filepicker.io
blog.filepicker.io
In Chrome, you can just press the "Deactivate Breakpoints" button in the DevTools and `debugger` statements won't do anything anymore. Closing the DevTools also prevents `debugger` statements from breaking execution.
if (this.foo()) debugger1. https://developers.google.com/chrome-developer-tools/docs/sc...
It’s better in many cases than manually setting a breakpoint in the inspector.
Why does the author believe that statement is true? I'd much rather manually set breakpoints in the inspector than have to alter code.edit: formatting
1) I have the code open in my text editor but not in the inspector. Rather than open it in the inspector and search around for where I need the breakpoint I can just pop it in the code and the inspector will open up where I need it.
2) Working with single page apps where breakpoints sometimes have a hard time persisting after a file changes. Nothing more frustrating than making a change and losing your breakpoints.
Also, "+new Date" is neat
Other than that, good tip.