How do you launch the JavaScript debugger in Google Chrome?

Kevin Driedger picture Kevin Driedger · Sep 15, 2008 · Viewed 634.9k times · Source

When using Google Chrome, I want to debug some JavaScript code. How can I do that?

Answer

Omer van Kloeten picture Omer van Kloeten · Sep 15, 2008

Try adding this to your source:

debugger;

It works in most, if not all browsers. Just place it somewhere in your code, and it will act like a breakpoint.