The debugger statement in JavaScript will cause a debugger (like FireBug or the Chrome developer tools) to pause execution just as if there was a breakpoint at that line. This is most useful when you have dynamically generated code or whenever you don't have a chance to set a breakpoint on a line before the code executes.
Simple example:
var a = 44;
debugger;
alert(a);
In this case the debugger (if open) will pause before the alert is shown.
Here are the
MDN docs for the debugger statement.
No way! Rad. I remember you suggesting I try this a long time ago but I guess I forgot about it. Gotta try it out. :)
ReplyDelete