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.

Douglas Crockford: “Advanced JavaScript” (2 of 3)

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.

One Response to “Javascript Debugger Statement”

  1. also try console.debug in firebug.

Leave a Reply