That’s the basic idea of stepping through code. If you look at the code in
get-started.js, you can see that the bug is probably somewhere in the
updateLabel() function. Rather than stepping through every line of code, you can use another type of breakpoint to pause the code closer to the location of the bug.
Line-of-code breakpoints are the most common type of breakpoint. When you’ve got a specific line of code that you want to pause on, use a line-of-code breakpoint. Try it now:
- Look at the last line of code in
updateLabel(), which looks like this:
label.textContent = addend1 + ' + ' + addend2 + ' = ' + sum;
... read the whole story at codeburst.io.