What is a single-line comment character in javascript
This article mainly explains "what is a single-line comment character in javascript". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what is a single-line comment character in javascript.
In javascript, the one-line comment character is "/ /", the syntax "/ / comment content", which is only valid for the line in which it is located; and everything after "/ /" is regarded as the content of the comment, but has no effect on the content before "/ /", so it can be used at the end of the code.
The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.
In javascript, an one-line comment begins with a double slash "/ /" and the one-line comment is a "/ /" in the syntax format:
/ / comment content
A single-line comment / / is valid only for the line on which it is located.
All the content after / / is regarded as the content of the comment, and has no effect on the content before / /. The sample code is as follows:
JavaScript / / add the specified content document.getElementById ("demo") [xss_clean] = "http://c.biancheng.net/js/";" to the tag whose id attribute is demo
Single-line comments can be used at the end of the code, as shown in the following example:
Var x = 5; / / declare the variable x, and assign 5 to it var y = Xerox 2; / / declare the variable y, and assign it to it so far. I believe you have a deeper understanding of "what is a single-line comment character in javascript". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!