What are javascript annotations?

(*-*)浩
Release: 2020-09-18 17:14:16
Original
3042 people have browsed it

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*/" .

What are javascript annotations?

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.

注释:注释不会被执行。

Copy after login

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.

注释:注释块不会被执行。

Copy after login

The above is the detailed content of What are javascript annotations?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
js
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!