Operators > || (OR)

|| (OR)

Syntax

expression1 || expression2

Arguments

expression1,expression2 A Boolean value or expression that converts to a Boolean value.

Description

Operator (logical); evaluates expression1 and expression2. The result is (true) if either or both expressions evaluate to true; the result is (false) only if both expressions evaluate to false.

With non-Boolean expressions, the logical OR operator causes Flash to evaluate the expression on the left; if it can be converted to true, the result is true. Otherwise, it evaluates the expression on the right and the result is the value of that expression.

Player

Flash 4 or later.

Example

The following example uses the || operator in an if statement:

want = true;
need = true;
love = false;
if (want || need || love){
trace("two out of 3 ain't bad");
}