转圈圈

运算符

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.

MDN:运算符优先级

posted @ 2019-01-01 22:15  rosendolu  阅读(121)  评论(0编辑  收藏  举报