Call Stack

In Chapter 8, “Functions and Methods,” you learned about the call stack, the list of functions that have been called. The Chrome Developer Tools give you a visual representation of the call stack on the right side, under Watch Expressions (see Figure 12.17). If we are stepping through the code, and execution is paused inside getImageHeight, we can see in the call stack that getImageHeight was called by replaceImages, which was called by main, which was called by (anonymous function). You can click any of the function names to see what line was being executed when the next function was called. This tool is useful for seeing how your code got to the point where it is currently paused.

Figure 12.17 Chrome Developer Tools give you a ...

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.