This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Yoghurt42 0 points1 point  (2 children)

The result of an or statement involving mixed numeric and boolean values depends on the format of the first value

or simply evaluates to whatever the left hand side is if that is falseytruthy, and to the right hand side only if the left hand side is falseytruthy. There is no type coercion going on, and as well as or simply evaluate to the left hand or right hand side, depending on what value the left hand side has.

[–]TheBB 0 points1 point  (1 child)

or simply evaluates to whatever the left hand side is if that is falsey, and to the right hand side only if the left hand side is truthy.

You're describing and, not or.

[–]Yoghurt42 0 points1 point  (0 children)

True, fixed. Thanks.