As logical expressions are evaluated left to right, they are tested for possible “short-circuit” evaluation using these rules:
false && anything is short-circuit evaluated to false. true || anything is short-circuit evaluated to true.
The rules of logic guarantee that these evaluations are always correct. Note that the anything part of the above expressions is not evaluated, so any side effects of doing so do not take effect.