Q:

Explain when operands are evaluated in the logical AND, logical OR, and equality operators

0

Explain when operands are evaluated in the logical AND, logical OR, and equality operators.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

The logical `AND` and `OR` operators follow the _short-circuit evaluation_ strategy. Which means:

  - they always evaluate their left operand before the right,

  - the right operand is evaluated _if and only if_ the left operand does not determine the result.

The equality operator evaluates both the left operand and the right operand, then compares those values. The order of evaluation of the two operands is undefined.

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now