Javascript comments include three types, namely: 1. Multi-line comments, the symbol is "/**/"; 2. Single-line comments, the symbol is "//"; 3. Single-line comments, the symbol is "
The operating environment of this article: Windows 7 system, javascript version 1.8.5, DELL G3 computer
What does the javascript comment include?
There are three comment methods in JavaScript language.
The first is multi-line comments "/**/", generally at the beginning of the js file, the author, function and other information are introduced.
The code is as follows:
c030c32b2413ddeb294650af21b46ce1The third method is not to add -->, this is different from html comments.
Summary:
It is recommended that you use the first method of multi-line comments. As for why? If you want to comment 100 lines of code, just add comments at the beginning and end. If you need to use the second method, you have to add comments on each line, which will increase the number of bytes in the file.
Recommended study: "JS Basic Tutorial"
The above is the detailed content of What does javascript annotation include?. For more information, please follow other related articles on the PHP Chinese website!