Home > Article > Web Front-end > What is the correct way to add comments in javascript
Adding comments in javascript The correct thing is that the "/**/" and "//" symbols, where "/**/" symbol can be used to make multi-line comments in js, and the "//" symbol can be used to make comments in js Single line.
The operating environment of this article: windows7 system, javascript version 1.8.5, DELL G3 computer
The correct comment to add in javascript is What?
Comments are very important in the programming process. There are three comment methods in the javascript (js) language
1. The first is multi-line comments”/**/ ", generally at the beginning of the js file, introduce the author, functions and other information.
/* author:xxx *day:2007-12-04 */
2. The second comment method is the most common "//", which can be seen everywhere in the program. It can only comment on a single line
//这是一行注释,只能注释单行。 //另一行注释
Recommended study: "javascript Advanced Tutorial 》
The above is the detailed content of What is the correct way to add comments in javascript. For more information, please follow other related articles on the PHP Chinese website!