What is the correct way to add comments in javascript

藏色散人
Release: 2023-01-07 11:42:55
Original
2732 people have browsed it

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.

What is the correct way to add comments in javascript

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 */
Copy after login

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

//这是一行注释,只能注释单行。
//另一行注释
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template