var currencyInfo = []; {% for id, currency in currencies %} currencyInfo[{{ id }}] = {name: "{{ currency.name }}", symbol: "{{ currency.symbol }}", code: "{{ currency.code }}"}; {% endfor %}