Example 3 - Javascript Debugger

The JavaScript Debugger enables you to step through JavaScript code and examine or modify its state to help track down bugs.

There are three ways to open the debugger:

You can set a breakpoint in one of the following ways:

Try to add some breakpoints and see what happens!

You can learn more about the Javascript Debugger in this MDN article.