Getting form variables data into twig templates
Three possible solutions:


Valid render array

You get a valid render array by putting the content of city and count in #markup elements:

  'city' =&gt; [
    '#markup' =&gt; 'Singapore',

Form variable with a #

Or start the variable name with a hash, so that it is no longer
considered to be a form element which needs to be rendered:

$form['#job_locations'] = ...


Twig:

{% for location in form['#job_locations'] %}
  ...
{% endfor %}

Separate template

Or create a custom template
with a variable for the locations array to theme the list separately from the
form:

$form['job_locations'] = [
  '#theme' =&gt; 'job_location_list',
  '#locations' =&gt; $job_locations,
];