Skip to main content
Skip table of contents

Guarded Statements

If assignment or append statements must be executed conditionally, the following syntax can be used:

Syntax

set object = expression if booleanGuardExpression;
append object to arrayExpression if booleanGuardExpression;

Semantics

The set and append statements are applied only if the boolean guard expression evaluates to true.

Substitutables

object

Any object name.

expression

A valid expression.

arrayExpression

An expression evaluating to an array.

booleanGuardExpression

Any expression evaluating to a boolean.

Examples

NONE
 set x = "abc" if y > 10;
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.