AND(&&) short circuit: In the case of AND, the expression is evaluated until we get one false result because the result will always be false, independent of the further conditions. If there is an expression with &&(logical AND), and the first operand itself is false, then a short circuit occurs, the further expression is not evaluated and false is returned.
Example: Below is an example of the Short circuiting operators.
false true true true
Example: Short-circuiting using AND(&&) operator.
OR(||) short circuit: In the case of OR, the expression is evaluated until we get one true result because the result will always be true, independent of the further conditions. If there is an expression with ||(logical OR), and the first operand itself is true, then a short circuit occurs, evaluation stops, and true is returned.
Example: Short-circuiting using OR(||).