> ## Documentation Index
> Fetch the complete documentation index at: https://reportana.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Logic

Logical operators can be used to create more complex conditions in our templates.

**Currently supported logical operators:**

`and`: Returns `true` if both the left and right operands are true.

*Example of use:*

```twig theme={null}
{# Both are true #}
{% if true and true %}
  {# Returns true #}
{% endif %}
```

`or`: Returns `true` if at least one of the operands, either left or right, is true.

*Example of use:*

```twig theme={null}
{# At least one is true #}
{% if true or false %}
  {# Returns true #}
{% endif %}
```

`not`: Negates an expression, inverting its logical value.

*Example of use:*

```twig theme={null}
{# Negates the logical value #}
{% if not false %}
  {# Returns true #}
{% endif %}
```

`(expr)`: Groups an expression to define operator precedence.

*Example of use:*

```twig theme={null}
{# Grouping expressions #}
{% if (true or false) and true %}
{# Returns true #}
{% endif %}
```
