4.1 String Direct Quantity
1. String Direct Quantity
。 can be 0 or more.
。 The string must be written on the same line. Too long with + number
。 Used to define start and end double quotes and single quotes must match
2. Escape characters in a string
Escape character |
The character represented by |
\' |
Single quotation mark |
\" |
Double quotes |
\\ |
Back slash |
\b |
Backspace |
\f |
Page breaks |
\ n |
Line feed |
\ r |
return character |
\ t |
Horizontal tab |
\v |
Vertical tab |
\xxx |
Latin-1 characters specified by 2-bit hex (XX) |
\xxx |
A latin-1 character specified by a 1-bit to 3-bit octal (1-377) |
\uxxxx |
Unicode characters specified by 4-bit hexadecimal number (XXXX) |
4.2 Number Direct Quantity
1. Integral type Direct quantity var a=10;
1. Decimal integer
28 integer first number must be 0,02,0123,047, note: ECMAScript does not support
36-in-process integers beginning with ox or 0x, OX123,OX12AF
2. Floating point Type Direct quantity
1. Traditional notation 12.345.2943 0.38
2. Scientific notation of 1.23e4=1.23x103=1230
4.3 Boolean Direct volume
4.4 Direct amount of array
var myarr=["My string", 123,];
4.5 Function Direct Quantity
function (argument list) {statement block in functions}
var myfunction=function (a,b) {return a+b};
4.6 Object Direct Quantity
{Property Name 1: Property value 1, property Name 2: Property value 2, property name 3, property value 3 ...}
var myobj={height:10,width:20,name: "Box"};
4.7 Special Direct Quantity
1.null Direct Quantity
var my=null;
2.undefined Direct Quantity
var mynumber=123;
Document.writer (MyNumber);
mynumber=undefined;
Document.writer (MyNumber);//equivalent to unassigned state
4.8 Character Set
JavaScript uses the Unicode character set
1.Unicode Character Set
For developers who are not in the English language, it is important to use the Unicode character set