The key thing to understand is that in JavaScript, boolean evaluations like this will stop evaluating as soon as they possibly can and return whatever the last evaluated value was.
For example, if the first operand of an
||
is
true
, it will stop because it doesn't matter what the second operand is. Likewise when the first operand of an
&&
is false, it will stop because it doesn't matter what the second value is