The direct amount is the value displayed in the program. Javascript direct quantity includes: String, number, Boolean, array, function, object, and special direct 4.1 string direct quantity
1. Direct string count
. It can be 0 or multiple.
. The string must be written in the same line. Too long + number
. Used to define that start and end double quotation marks and single quotation marks must match
2. escape characters in strings
Escape characters |
Characters |
\' |
Single quotes |
\" |
Double quotation marks |
\\ |
Backslash |
\ B |
Escape Character |
\ F |
Page feed |
\ N |
Line Break |
\ R |
Carriage Return |
\ T |
Horizontal Tab |
\ V |
Vertical Tab |
\ XXX |
Latin-1 characters specified by two-digit hexadecimal notation (xx) |
\ XXX |
Latin-1 characters specified by octal sequence (1-377) from 1 to 3 |
\ UXXXX |
Unicode characters specified by 4-digit hexadecimal number (xxxx) |
4.2 direct numeric count
1. The direct integer value var a = 10;
1. Decimal integer
The first number of the 2nd octal integer must be 0, 02, 0123,047. Note: ECMAScript does not support
A hexadecimal integer starting with ox or 0x, ox123, ox12AF
2. Floating Point Direct Volume
1. traditional LOG method 12.345. 2943 0.38
2. Scientific note 1.23e4 = 1.23x103 = 1230
4.3 Boolean direct quantity
4.4 direct array count
Var myarr = ["my string", 123,];
4.5 direct function quantity
Function (parameter list) {statement block in the function}
Var myFunction = Function (a, B) {return a + B };
4.6 direct object volume
{Attribute name 1: attribute value 1, attribute name 2: attribute value 2, attribute name 3, attribute value 3 .....}
Var myobj = {height: 10, width: 20, name: "box "};
4.7 Special direct traffic
1. null direct quantity
Var my = null;
2. undefined Direct Volume
Var mynumber = 123;
Document. writer (mynumber );
Mynumber = undefined;
Document. writer (mynumber); // equivalent to the unassigned status
4.8 Character Set
Javascript uses the Unicode Character Set.
1. Unicode Character Set
For developers who are not in English, using the Unicode Character Set is very important.