ADD A JAVASCRIPT BREAKPOINT

As you examine a JavaScript source code file, you may be able to gain only limited insight into its purpose and process by reading the code; you may need to be able to execute it and watch the process unfold. The best way to do this is to set up a JavaScript breakpoint in the Chrome Inspector.

If you have used a debugger in any native application environment before, the process is essentially the same, except much simpler. The JavaScript debugger is built right into the interpreter and browser, and there is no compiler involved; therefore, you can quickly execute, intervene, monitor, and manipulate JavaScript code in your program.

The first step is to configure a line of the JavaScript code as a breakpoint. This line, ...

Get HTML5: Your visual blueprint™ for designing rich web pages and applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.