How to use boolean operators in js

Operation rules: If the first operator returns true, return the value of the second operator (not a Boolean value); if the first If an operator returns false, the first operator is returned, and the second operator is no longer evaluated (short circuit) // &# 39; a’ converted to boolean is true, so directly return the second operator ” & # 39; a & # 39; & & & # 39; & # 39; // & # 39; & # 39; converted to boolean is false, so return the first operator directly & # 39; & # 39; '' && 'a' Or operator (||) Or Operators are also used for the value of multiple expressions Operation rules: If the Boolean value of the first operator is true, then return the value of the first operator directly; if the first operator If the Boolean value of an operator is false, then return the value of the second operator // Boolean value of '' is false, so here returns ‘b’ & # 39; & # 39; || & # 39; b & # 39; // The boolean value of ‘b’ is true, so here returns ‘b’ & # 39; b & # 39;…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索