Expressions
Overview
In most blocks in Pliant (such as If), expressions could be used for specifying conditions. The expression syntax follows some common JavaScript rules.
There are different types of operators that could be used to build expressions. In this article we will name a few:
1. Arithmetic operators - like “+” for addition, “*” for multiplication, and “%” for remainder
Example: if ($i + 3 == 7)
2. Equity operators - like “==” for equal to and “!=” for not equal to
Example: if ($i != 5)
3. Identity operators - like “===” and “!==” for testing if data types are the same
Example: typeof $A18.result === 'object'
4. Logical operators - like “||” for OR and “&&” for AND
Example: if ($i != 5 && $p == 2)
5. Comparison operators - like “>” for greater than and “<=” for less than or equal to
Example: if ($i > 6)
6. Conditional operators - like if equal to true or false
Example: if ($testvariable1 == true)
7. Variable as a condition - just the name of the variable, $testvariable1 would equal to true if set and false if not
Example: if ($testvariable1)
8. Subconditions
Example: $fullname.includes("Smith")