The JavaScript operator
Learning Essentials:
An expression
Operators: Unary operators, arithmetic operators, relational operators, logical operators, * bitwise operators, assignment operators
I. Expressions
Expressions have constant expressions, variable expressions, and compound expressions.
Second, arithmetic operators
Unary:+ (plus),-(minus sign), + + 、——
Binary: *,/,%,+,-
Third, relational operators
= =, = = = PS: The equivalent operator is more stringent than the equality operator, and the equivalent operator returns true only if the two operand types are the same and the values are the same.
<, <=, >, >=
Instanceof operator, in operator: In the case of an object, the in operator compares the property name of the object;
For arrays, the in operator compares the subscript of an array.
Four, logical operators
&&, | |,!
V. Bitwise OPERATORS
&, |, ~ (non) (This operation uses the original code, complement, negation, etc.), ^ (XOR)
>>, <<,
Vi. Other operators
Conditional operator:? :
String operator: +
Other operators: New, void, typeof,. (object property access), [] (array element access), delete, this
Vii. Precedence of Operators
Basic JavaScript Learning (iii)