How to pass an array to a template?
The variable names in the render array and theme hook need to match:

array(
  '#theme' =&gt; 'myTheme',
  '#test_var' =&gt; $this-&gt;t('Test Value'),
  '#doubles' =&gt; array('key'=&gt;$myArray),
);


Iterating an array in Twig is pretty straightforward:

{% for key,value in doubles %}
  Key : {{ key }}
  Value : {{ value }}
{% endfor %}