Logical operations with short-circuiting
expr1 && expr2
represents a logical
AND
operation that employs short-circuiting behavior. That is, expr2
is not
evaluated if expr1
is logical 0
(false
). Each expression must evaluate to a scalar logical
result.
expr1 || expr2
represents a logical OR
operation that employs short-circuiting
behavior. That is, expr2
is not evaluated if
expr1
is logical 1
(true
). Each expression must evaluate to a scalar logical
result.