Lexical structure

1. Comment
js supports comments in two formats.
(1) The text after the "//" line will be ignored.
(2) The text between "/*" and "*/" in the same line or different lines will be ignored as comments.
For example:
//Single-line comment
/*Single-line comment*/
/*Multi-line comment
Multi- line comment
Multi-line comment
*/
2. Direct quantity
is the data value directly used in the program.
For example:
10 //Number
2.1 //Decimal
"good morning" //String
'good' //String
true //Boolean
false //Boolean
3. Identifiers
In js, identifiers are used to identify variables and Function names, or used as markers for jumping positions in certain loop statements in js code. Must start with a letter, underscore (_) or dollar sign ($), and subsequent characters can be letters, numbers, underscores or dollar signs (numbers cannot be the first character).
For example:
a
all_class
_class
our_class1
$our

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326337085&siteId=291194637
Recommended