Operators
Operators are constructs used to manipulate individual data items and data sets. These include arithmetic, comparison, and logical operations.
Relational operators
The following relational operators are supported by using standard operator notation:
-
Equal
-
Not equal
-
Less than
-
Less than or equal to
-
Greater than
-
Greater than or equal to
Each symbolic operator can also be specified as a purely alphabetic equivalent that is case insensitive.
All operator notations except for |
Alphabetic relational operator | Examples | ||
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
Checks if a value matches the regular expression pattern.
|
Logical operators
All logical operator notations except for |
Logical operator | Example |
---|---|
|
|
|
|
|
|
Mathematical operators
All the following operators used for binary operation require a leading and trailing space.
Mathematical operator | Description | ||||
---|---|---|---|---|---|
|
Add numbers or concatenate if one of the operands is a string.
|
||||
|
Subtraction
|
||||
|
Multiplication
|
||||
|
Division
|
||||
|
Modulus: Get remainder after division
|
||||
|
Exponential Power
|
Ternary operator
You can use the ternary operator to perform single line if-then-else logic expressions.
user.enabled ? 'Active' : 'Inactive'
Elvis operator
The Elvis operator is a short form for the Ternary operator for null checks. This operator requires a leading and trailing space.
You can rewrite user.id != null ? user.id : 'N/A'
as user.id
?: 'N/A'
.