What is the correct syntax for using merge to create an array of field values from an element query? I grab some values via an element query:

{% set events = craft.entries.section('events').status('live,pending').order('postDate asc') %}


But I need to put them into an array for use in a Craft-styled form field.

Twig documentation shows how to put text values in an array and merge them:

{% set items = items|merge({ 'peugeot': 'car', 'renault': 'car' }) %}


But how do I do this with the results of my element query?
Just put the field names in parentheses:

{% set options = [] %}
{% for event in events %}
  {% set options = options|merge({ (event.slug):(event.eventTitle) }) %}
{% endfor %}


And now I can output them in the format Craft wants for a form field:

{{ forms.selectField({
  label: "Choose event"|t,
  name: "eventSlug",
  options: options,
}) }}