Operator summary
Operator summary | ||
species | symbol | meaning |
Arithmetic Operator | + | Plus sign, plus sign, string concatenation |
- | Minus, minus | |
* | multiplication | |
/ | division | |
% | Modulus (ie take the remainder) | |
++ | Self-increasing | |
-- | Decrement | |
Assignment operator | = | Assignment |
+= | Plus equals | |
-= | Minus equal | |
*= | Multiply equals | |
/= | Divide equal | |
%= | Modulo equal | |
Comparison operator | == | equal |
!= | not equal to | |
< | Less than | |
> | more than the | |
<= | Less than or equal to | |
>= | greater or equal to | |
Logical Operators | & | versus |
| | or | |
^ | XOR | |
! | non- | |
&& | Short circuit with | |
|| | Short circuit or | |
Bit operator | & | Bitwise and |
| | Bitwise or | |
^ | Bitwise XOR | |
~ | Negate | |
<< | Shift left | |
>> | Shift right | |
>>> | Unsigned right shift | |
Conditional operator | ?: | Equivalent to double branch structure |
Operator precedence
PS: In actual development, we will not write particularly complex expressions, if you want to count whoever you want to use ()