Yaffs site version 1.1
[yaffs-website] / vendor / twig / twig / doc / functions / max.rst
1 ``max``
2 =======
3
4 .. versionadded:: 1.15
5     The ``max`` function was added in Twig 1.15.
6
7 ``max`` returns the biggest value of a sequence or a set of values:
8
9 .. code-block:: jinja
10
11     {{ max(1, 3, 2) }}
12     {{ max([1, 3, 2]) }}
13
14 When called with a mapping, max ignores keys and only compares values:
15
16 .. code-block:: jinja
17
18     {{ max({2: "e", 1: "a", 3: "b", 5: "d", 4: "c"}) }}
19     {# returns "e" #}
20