4 ms·
Indeed. Learning that debugger; will stop the interpreter at any point you like, with console scoped at that point, has sped up my JS'ing greatly
by minikomi 14y ago
Indeed. Learning that
debugger;
will stop the interpreter at any point you like, with console scoped at that point, has sped up my JS'ing greatly
- grinnick 14y agoWait you can what!?? Holy moly, I've been writing JS for like 3 years now and I never knew this.
- chunkbot 14y agoHoly shit! I've been programming in JavaScript for years and never heard about the debugger statement. This looks great for really understanding the details of JavaScript's object model.
- afandian 14y agoDoesn't a breakpoint do exactly the same thing?
- minikomi 14y agoYep! I find it easier to use the debugger statement though when changing code a lot. Also, some places like compiled templates are difficult to set the breakpoint so it's useful there too.
- jasonkostempski 14y agoAlso that little stop sign shaped pause button in Chrome will 'Pause on all exceptions' (blue) or 'Pause on all uncaught exceptions' (purple, I usually leave it on this).
- joelhooks 14y agoJust watch out, we get these committed semi-frequently. Whoops!