Three ways to write comments in JavaScript: 1. Multi-line comments, the syntax "/* Content to be commented */"; 2. Single-line comments, the syntax "// Content to be commented"; 3. "< ;!-- Content to comment".
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
JavaSciprt comments will not be read by the browser and will be automatically skipped. Writing comments is important for you to go back and check quickly later. When writing comments, try to be concise and detailed. Let’s talk about the comments. Three basic ways
1. Multi-line comments
Syntax:
/* 这里写上要注释的东西*/
2. Single-line comments
Grammar:
// 要注释的内容
3, <!--
<!-- 要注释的内容
The above is the detailed content of Why are there three ways to write comments in JavaScript?. For more information, please follow other related articles on the PHP Chinese website!