title: How to use .map() ? I want to select querySelectorAll() + .map() to return Array with Index(name)
body: <p>I need to create a variable array with index (name) = value, referring to   html, example of what this array would look like:</p>
  <pre><code>var array = [];
  array['name'] = 'value';
  array['car'] = 'Ferrari';
  array['car2'] = 'BMW';
  array['color'] = 'Red';
  console.log(array);
  </code></pre>
  <p>In my Html I'm using the .map() function to get the values but the array that is formed has an automatic index, how to define the array's index so that it is equal to the name field??</p>
  <pre><code>&lt;select multiple&gt;
        &lt;option value=&quot;car&quot;&gt;Ferrari&lt;/option&gt;
  Array ['car'] = 'Ferrari' ;
  </code></pre>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let list = document.querySelectorAll("option");
  let items = Array.from(list).map(elem =&gt; elem.text);
  console.log('items: '+items);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select style="width:130px ;"  multiple&gt;
       &lt;option value="car" selected&gt;Ferrari&lt;/option&gt;
       &lt;option value="car2"&gt;BMW&lt;/option&gt;
       &lt;option value="color"&gt;Red&lt;/option&gt;
       &lt;option value="color2"&gt;Black&lt;/option&gt;
  &lt;/select&gt;</code></pre>
  </div>
  </div>
  </p>