Boolean operations
Pulsar supports boolean operations such as and
, or
but the syntax is a bit different than in other languages. Instead of operators, you use functions:
You can also chain boolean operations, using functions inside functions:
The following boolean functions are available:
And
and
results to true when all statements were true. and
is a variadic function, and it can take as many parameters as you want:
Or
or
results to true when at least one of the statements is true. or
is a variadic function, and it can take as many parameters as you want:
Not
not
negates the boolean value, meaning true
becomes false
and vice versa.
Note from developers: We are planning to add support for true operators as soon as possible, so consider this a workaround. For more complex logic, you should opt to use javascript helpers instead.
There are engine-related challenges with supporting operators that need to be solved before they can be implemented, especially about precedence controlled with brackets (var1 && var2) || var3
, as brackets are currently exclusively used for function invocations. If you would like to work on problems like this, consider joining our team!
Last updated
Was this helpful?