Home >Web Front-end >JS Tutorial >How to comment multiple lines in javascript
Multi-line comments "/**/" to comment multi-line statements, syntax "/*Multi-line comment information*/" can be used in javascript. In a multi-line comment, any characters contained between the "/*" and "*/" symbols are treated as comment text and ignored. Comments are explanations and explanations of the code, and their purpose is to make it easier for people to understand the code.
The operating environment of this tutorial: Windows 7 system, ECMAScript version 5, Dell G3 computer.
Comments are explanations and explanations of the code, and their purpose is to make it easier for people to understand the code. Comments are when the programmer writes an explanation or hint for a statement, program segment, function, etc., which can improve the readability of the program code.
JavaScript multi-line comments
Multi-line comments start with /*
and end with */
.
Syntax:
/*多行注释信息*/
Example:
<script type="text/javascript"> /*下面的代码将输出: * 一个标题和两个段落 */ document.write("<h1>This is a header</h1>"); document.write("<p>This is a paragraph</p>"); document.write("<p>This is another paragraph</p>"); </script>
in a multi-line comment, enclosed in /*
and */
symbols Any characters between are treated as comment text and ignored.
[Recommended learning: javascript advanced tutorial]
The above is the detailed content of How to comment multiple lines in javascript. For more information, please follow other related articles on the PHP Chinese website!