This is the logical OR operator and it returns a value of true if
one or both of the operands is true. It works by first evaluating the
left-hand operand and, if this is true, disregarding the right-hand
one and returning true for the whole expression. If, however, the left-hand
operand is false, then it returns the value of the right-hand operand:
true or false if Boolean, or else the value itself.
...while this one returns 'cheese':
If, however, the first operand is not a Boolean value, the OR operator
returns the value of the first operand whether the second is true or
not; in the next example 'bread':
if((a == c) || (b == 9))
x = (a > b) || (c == 3)
These examples both return true.
x = (a > b) || "cheese"
This example returns 'cheese'.
x = "bread" || (c == 3)
If, however, the first operand is not a Boolean value, the OR operator returns the value of the first operand whether the second is true or not; in this next example 'bread'.