Operators > && (short-circuit AND)
&& (short-circuit AND)Syntax
expression1
&&
expression2
Arguments
expression1, expression2
Numbers, strings, variables, or functions.
Description
Operator (logical); performs a Boolean operation on the values of one or both of the expressions. Causes the Flash interpreter to evaluate expression1
(the left expression) and returns false
if the expression evaluates to false
. If expression1
evaluates to true
, expression2
(the right) is evaluated. If expression2
evaluates to true
, the final result is true
; otherwise, it is false
.
Player
Flash 4 or later.
Example
This example assigns the values of the evaluated expressions to the variables winner
and loser
in order to perform a test:
winner = (chocolateEggs >=10) && (jellyBeans >=25); loser = (chocolateEggs <=1) && (jellyBeans <= 5); if (winner) { alert = "You Win the Hunt!"; if (loser) { alert = "Now THAT'S Unhappy Hunting!"; } } else { alert = "We're all winners!"; }