The if...else conditional statement allows you to test a condition and execute a block of code if that condition exists, or execute an alternative block of code if the condition does not exist. For example, the following code tests whether the value of x exceeds 20, generates a trace() statement if it does, or generates a different trace() statement if it does not.
if (x > 20) {
trace ("x is > 20");
}
else {
trace ("x is <= 20");
}
If you do not want to execute an alternative block of code, you can use the if statement without the else statement.