Home > Web Front-end > JS Tutorial > body text

How to debug code when js encounters code problems

angryTom
Release: 2020-02-05 17:54:19
forward
2019 people have browsed it

This article introduces the debugging method if you encounter problems when writing JavaScript code. I hope it will be helpful to all students learning JavaScript!

How to debug code when js encounters code problems

How to debug code when js encounters code problems

Single-step tracking debugging debugger;

The console watch function checks the current value of the variable

Enters the function operation

As it continues Click to continue looping, and the value of the specified variable is also changing

Add a breakpoint

Jump in Jump out of the function

throw new Error() actively throws an exception

The following code will no longer run

The code will jump Go to the try statement closest to this sentence

Use

try{
}catch(e){
}
Copy after login

Receive exception


##




    
    Document

Copy after login





    
    Document

Copy after login
This article comes from the

js tutorial column, welcome to learn!

The above is the detailed content of How to debug code when js encounters code problems. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!