运算符
Logical Operators
| Operator | Description | Useage |
|---|---|---|
Logical AND (&&) |
expr1 && expr2 | Returns expr1 if it can be converted to false; otherwise, returns expr2. Thus, when used with Boolean values, && returns true if both operands are true; otherwise, returns false. |
| Logical OR (` | `) | |
Logical NOT (!) |
!expr | Returns false if its single operand can be converted to true; otherwise, returns true. |
Falsy
- null;
- NaN;
- 0;
- empty string ("" or '' or ``);
- undefined.

浙公网安备 33010602011771号