1. Print out information
Console.log for common printing information
Console.table Print object information;
Console.trace (' trace car ') looks at the function's call stack, particularly effective.
3. Breakpoint Debugging
There are three ways to
First, directly find the code line add a breakpoint;
Second, add debugger in the code, the browser will automatically stop in the debugger
Enter Debug (car.funcy) on the console.
if{ debugger;}
4. Responsive commissioning
You can debug a mobile-side viewshed
5. Count the time required for code block execution
Particularly effective for statistical optimization of loops
console.time(‘Timer1‘);var= [];for(var=0;<100000; i++){ items.push({index: i});}console.timeEnd(‘Timer1‘);
7.
{}Beautify the compressed code 8. Parameters accepted by the monitoring function
In console inputmonitor(functionName)
9. Quick access to elements
Enter $ (' Css-selector ') in the console to return the first matching element;
$$ (' Css-selector ') will return all matching elements.
10. You can edit the network request by right-clicking on the Network tab.
This action is used to fill in missing field re-request parameters, perfect parameters are particularly effective
11. Right-click on the DOM panel to add monitoring to see why DOM elements change
JavaScript Debugging Tips