/
Logical Operators

Logical Operators

and

Helper that renders the block if all of the given values are truthy. If an inverse block is specified it will be rendered when falsy. Works as a block helper, inline helper or subexpression. In the following example t1,t2 variables are true and f1 is false.

Block expression:

{{#and t1 t2 t3}} will be rendered {{else}} (optional): will be shown when and is false {{/and}}

Subexpression:

{{#if (and t1 t2 f1)}} will not be rendered (because f1 is false) {{/if}}

or

Helper that renders a block if any of the given values is truthy. If an inverse block is specified it will be rendered when falsy. Works as a block helper, inline helper or subexpression. In the following example t1 variable is true and f1, f2 are false.

Block expression:

{{#or f1 f2 t1}} will be rendered {{else}} (optional): will be shown when or is false {{/or}}

Subexpression:

not

Returns the inverse boolean of the provided value. I.e. it returns false when the provided expression is true and vica versa. Works as block expression or inline expression:

Block expression:

Inline expression:

Related content

Control Directives
Control Directives
More like this
Conditionals
Conditionals
More like this
Variables
Variables
More like this
More about IdealDoc functions
More about IdealDoc functions
More like this
Subexpressions
Subexpressions
More like this
Lookup
More like this