首页 > 其他 > 详细

Logical Operators

时间:2019-01-01 23:13:38      阅读:175      评论:0      收藏:0      [点我收藏+]

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 (||) expr1 || expr2 Returns expr1 if it can be converted to true; otherwise, returns expr2. Thus, when used with Boolean values, || returns true if either operand is true.
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.

Logical Operators

原文:https://www.cnblogs.com/rosendolu/p/10206347.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!