From the course: Learning JavaScript Debugging
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution: Knowing when to stop - JavaScript Tutorial
From the course: Learning JavaScript Debugging
Solution: Knowing when to stop
(electronic music) - [Instructor] Here's one possible solution to this breakpoint challenge. Let's look at the checkout first. I'm going to open up my developer tools and here in the sources panel, this is conveniently opened up to the script block at the bottom of the file because I was already looking at it. And here is my event handler that's dealing with these close buttons. I'm using the element query selector here to grab the button close class, which if we inspect this element, I can right click and inspect that. I can see that both close button up in the corner and the close button down in the panel both have that same class. So the intention here was to grab either one of them and have them both use this same event handler. If I set a break point in here, this close button is caught by that handler. So that one definitely works as we can see. But if I open this again, I can click this as much as I want…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Debugging without a debugger5m 16s
-
(Locked)
Leverage more of the Console API7m 4s
-
Stop and look around: Simple breakpoints5m 24s
-
(Locked)
Explore other breakpoint options7m 47s
-
(Locked)
Challenge: Knowing when to stop2m 28s
-
(Locked)
Solution: Knowing when to stop3m 56s
-
(Locked)
Step into, over, and out of functions5m 48s
-
(Locked)
Find out where you are using the call stack4m 34s
-
(Locked)
Monitor variables with watches5m 16s
-
(Locked)
Source maps to debug minified files4m 41s
-
(Locked)
Challenge: Putting it all together4m 10s
-
(Locked)
Solution: Putting it all together8m 52s
-
(Locked)
-
-