Using the Debugger Module #50 Flashcards
Where is the “Debugger” tool found?
In the sources panel.
What is a breakpoint in JavaScript?
In its simple form, a breakpoint is a breakpoint instruction put in your code. When the browser meets it, it stops.
What’s another way to set a breakpoint in the code?
Another option is to open the file in the Sources panel and click the number on the line you want to add a breakpoint:
How can you remove a breakpoint
By double clicking on it
What other kinds of breakpoints are there?
- XHR/Fetch
- DOM
- Event Listener (triggered an event occurs like, clicks.)
What’s displayed in the “Scope” panel?
Variables
What happens inside of the “Watch” panel?
There is a small + button that you can use to watch any expression. You can also add expressions or call variables to see what they might do.
What are the three main ways to control flow during debugging?
- Normal (highlighted in blue)
- Step over (resumes execution until the next line and then stops again.
- Step out: goes back to the outer function that is calling the one you’re in.
How could you temporarily edit a script in DevTools?
While the script is halted, edit the files and hit command/ctrl S for temporary saving
How can you see what’s in the call stack?
The call stack is just below the Debugger and it will tell you how many function levels deep you are in the code.
You can move up too by clicking each function name.
If you don’t want to step into the code because it is a trusted library or script what can you do to avoid inspecting it?
Right-click it in the call stack and press Blackbox script.