JS debugging a lot of methods, today summed up the most practical breakpoint method:
Debugger Breakpoint
This is very common, but many people do not know can actually add conditions to judge
if (something) {debugger;}
SOURCE Breakpoint
This is the most common, do not do too much explanation, specifically say a few important icons:
The recovery script executes to the next breakpoint
Skip to Next line
Enter Current function
Jump out of the current function
Toggle Breakpoint on/Off
Automatic breakpoint in case of exception
Where "into the current function" and "out of the current function" is easy to confuse, in fact, in most cases, the difference is not small, the difference is: if the current breakpoint statement is a function execution statement, such as a (), the "Enter the current function" will enter its function body, jump out of the current function is not.
Dom Breakpoint
Select the DOM element and right-click on to select subtree modifications (the child node tree is changed), attribution modifications (attribute changed), node removal (nodes removed), add nodes, Can be viewed in source-->dom breakpoints or element-->dom breakpoints
Event Listener (Listener) Breakpoint
Source-->event Listener breakpoints can be viewed in the event monitoring breakpoint, in the checkbox to listen to all the corresponding events on the page
XHR Breakpoint
We can add a breakpoint condition to an asynchronous breakpoint by source-->xhr breakpoints "+" on the right, and the JS logic automatically generates a breakpoint when the URL satisfies this condition when the asynchronous request is triggered.
JS Debug Notes