The other answers are more than adequate, I'm including my answer here for posterity just in case someone else's brain works like mine:
The result of the boolean ||
and boolean &&
operators will always be the result of the last expression evaluated, taking into consideration short circuiting.
So, for ||
, if the first expression is truthy, short circuit evaluation means that the rest is ignored, and the result will be the value of that first expression. If it's falsy, evaluation must continue to the second expression, and the result will be the result of that second expression no matter whether it's truthy or falsy.
Likewise for &&
, if the first expression is falsy then evaluation stops and the result is the result of that first expression, if it's truthy then evaluation continues and the result is the result of the second expression.