Twig loops
This example is in a custom paragraphs template
<nav class="orbit-bullets">
{# Loop through for the bullets. #}
{% for key, item in content.field_slides if key|first != '#' %}
<button {% if loop.first %}class="is-active" {% endif %}data-slide="{{ key }}">
<span class="show-for-sr">{{ trans }}Slide {{ key + 1 }} details.{{ endtrans }}</span>
</button>
{% endfor %}
</nav>