Syntax
if(condition) {
statement(s);
}
Arguments
condition: An expression that evaluates to true or false.
statement(s): The instructions to execute if or when the condition evaluates to true.
Returns
Nothing.
Description
Action: Evaluates a condition. If condition evaluates to true, then statements(s) within {} are executed.
Sample
a = 2;
b = 1;
if (a > b) {
trace("a > b");
}
// "a > b" will be displayed in 'Debug' window. If a < b, nothing will be displayed.
See Also
else and else if.