Javascript Debugger Statement
I’ve been working on debugging Javascript lately and found this gem from the talk “Advanced JavaScript” on Yahoo! YUI theater very interesting.
Javascript as a language spec does not have a debug statement, however all implementations do implement a debugger statement.
To use this in something like Firebug you just need to write code like this:
if(someConditionYouWantToSetBreakPointOn)
{debugger;
}
The video is great for really understanding the nitty gritty details of Javascript prototype object model. If the phrase “parasitic inheritance” gives you a rubytasticnerdgasm, this video is for you.
also try console.debug in firebug.