how to get the last iteration of unknown array twig code example
Example 1: twig loop variables
{% for user in users %}
{{ loop.index }} - {{ user.username }}
{% endfor %}
Example 2: index first twig
{{ loop.index }}
OR
{{ loop.index0 }}
{% for user in users %}
{{ loop.index }} - {{ user.username }}
{% endfor %}
{{ loop.index }}
OR
{{ loop.index0 }}