Inspecting, Watching, and the Console

With your code execution paused at a breakpoint, you can do some really cool things. First, you can view the value of a variable by hovering your mouse over it (you have to admit, that’s a lot better than using alert or even console.log). If you don’t want to keep hovering over a variable, you can add it to your list of watch expressions, and the values of the variables will update as your code executes. You can add a variable to watch expressions by clicking the + and then typing the variable’s name. See Figure 12.14.

Image

Figure 12.14 Watch expressions let you quickly see updates to variables you want to keep ...

Get Learning to Program 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.