PRO: twig-Loop with key and value

JSON: https://api.json-content-importer.com/extra/json/thebluealliance.json

Twig-code using for-loop with access to key and value of JSON-data-array (slice: start at item 2 and loop through 3 items):

{% for key, val in oprs | slice(2,3) %}
    <li>{{key}}: {{val }}</li>
{% endfor %}

In Action:

  • 0: 115.64474123
  • 1: 100.745187357
  • 2: 115.323770882