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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.