I. Expressions
1. The JS interpreter can calculate it to generate a value;
2. The simplest expression is the direct amount or variable name. The value of the direct amount expression is the direct amount;
[Javascript]
123;
"I am a string"
(I + 1.7;
(A + 3) * sum;
Ii. Operators
1. Most operators are symbols, such as "+" and "-", but some operators are represented by keywords, such as "delete ";
The P column indicates the priority of each operator. The value of a number is greater than that of a small number.
Iii. Equal operators = and equal operators =
1. = is allowed type conversion, === must be completely equal
2. = rules:
A. If the two values have different types, they are different;
B. If the two values are of the numeric type, they are equivalent if they are not Nan.
C. It is equivalent
D. If the two values point to the same reference, they are equivalent
E. If both are null or undefined, they are equivalent
3 .! = And! = Is the opposite rule
IV. in Operator
1. The number of operations on the left is a string, or can be converted to a string. The number of operations on the right is an object or array;
2. If the left value is an attribute name of the right object, true is returned;
[Javascript]
Var point = {x: 1, y: 1 };
Var has_x_coord = "x" in point; // true
Var has_y_coord = "y" in point; // true
Var has_z_coord = "z" in point; // false
Var ts = "toString" in point; // true
V. instanceof
Returns true if the object on the left is an instance of the right class.
6. String operator www.2cto.com
1. <<=>= the Unicode used to determine the sequence
2. + the priority of string operators is higher than that of numbers
[Javascript]
1 + 2; // 3
"1" + 2; // 12
11 <3; // false
"11" <3; // true
1 + 2 + "abc"; // 3abc
"Abc" + 1 + 2; // abc12
By: dxh_0829