News for hackers. Stuff that matters.
Re:Learning JavaScript - my experience and advice by minikomi on Monday March 25, 2013 @01:21AM (#5435620)
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
Re:Learning JavaScript - my experience and advice by grinnick on Monday March 25, 2013 @03:48AM (#5435899)
Wait you can what!?? Holy moly, I've been writing JS for like 3 years now and I never knew this.
Re:Learning JavaScript - my experience and advice by minikomi on Monday March 25, 2013 @03:57AM (#5435917)
Yep - as long as dev tools are open. Works everywhere, even in eg. underscore templates, backbone init functions..
Re:Learning JavaScript - my experience and advice by thisone on Monday March 25, 2013 @11:54AM (#5437670)
chrome extension content scripts...
Re:Learning JavaScript - my experience and advice by d0gsbody on Monday March 25, 2013 @12:05PM (#5437744)
You should watch Discover DevTools then.
Re:Learning JavaScript - my experience and advice by chunkbot on Monday March 25, 2013 @08:18AM (#5436582)
Holy 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.
Re:Learning JavaScript - my experience and advice by jasonkostempski on Monday March 25, 2013 @08:59AM (#5436707)
Also 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).
Re:Learning JavaScript - my experience and advice by afandian on Monday March 25, 2013 @08:46AM (#5436662)
Doesn't a breakpoint do exactly the same thing?
Re:Learning JavaScript - my experience and advice by minikomi on Monday March 25, 2013 @09:23AM (#5436792)
Yep! 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.
Re:Learning JavaScript - my experience and advice by joelhooks on Monday March 25, 2013 @09:32AM (#5436827)
Just watch out, we get these committed semi-frequently. Whoops!