Javascrip comment characters are divided into single-line comment characters "//" and multi-line comment characters "/**/". Single-line comments start with "//", followed by the comment content, and the syntax is "//comment content"; multi-line comments start with "/*" and end with "*/" ending with the comment content in the middle. The syntax is "/* comment content*/" .
JavaScript Comments
JavaScript will not execute comments.
We can add comments to explain JavaScript or improve the readability of the code.
Single-line comments start with //.
Example
The following example uses a single-line comment to explain the code:
Welcome to my Homepage
This is my first paragraph.
注释:注释不会被执行。
JavaScript Multi-line Comment
Multi-line comments start with /* and end with */.
The following example uses multi-line comments to explain the code:
Example
Welcome to my Homepage
This is my first paragraph.
注释:注释块不会被执行。
The above is the detailed content of What are javascript annotations?. For more information, please follow other related articles on the PHP Chinese website!