How do you debug JavaScript?

Joe Parry suggested by email to write a follow up to the post about JavaScript IDEs. That’s also one of the common questions and I intended to include it on the first post but I forgot :S

I’ve heard many people referring to Firebug as the best way to debug when coding JavaScript but I’ve never got to try it out properly as I started coding directly with/for Chrome. So in my case I mainly use the Webkit Inspector/Developer Tools panel.

However, rather than debug the code I usually log stuff instead for which console.log(), console.log(), console.error(), console.warn(), console.info() gives me way more than I need. Specially coming from Flash where the console is so basic that everyone keeps building their own logging library.

At this last Google I/O I saw this presentation about the Developer Tools that left me quite impressed of how much stuff I was missing.

[youtube http://www.youtube.com/watch?v=TH7sJbyXHuk&w=350&h=300]

No Responses to “How do you debug JavaScript?”

Post a Comment