ADD A WATCH EXPRESSION
With a watch expression, you can create a JavaScriptlike statement inside the Chrome Inspector itself and actually watch it change as you step through the code. This can be extremely useful if a function is being executed with the wrong input variable, when the variable itself changes as each line of code is executed, and you want to monitor the function and how the input variable is calculated. Effectively, a watch expression is exactly like reexecuting the same line of code every time the main execution process pauses and examining the results.
This may seem like a convoluted use case right now, but as you explore and begin to debug jQuery, watch expressions will become a valuable tool. This is especially true if you ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access