The return value of the && and || operations in JS

The && operation has two cases:
when the expression is true, the value of the last
expression is returned. When the expression is false, the value of the first expression that is false is returned.

The || operation also has two cases:
when the expression is false, the value of the last expression that is false is returned.
When the expression is true, the value of the first expression that is true is returned.

Guess you like

Origin blog.csdn.net/qq_43665244/article/details/115027942