title: Create object from forEach
body: <p>I'm trying to figure out if there's a way to rewrite this code as a single object creation:</p>
  
  <pre><code>my_array = [
    {key: 1, value: "foo"},
    {key: 2, value: "bar"}
  ];
  
  let my_obj = {};
  my_array.forEach((elem) =&gt; {
    my_obj[elem.key] = elem.value;
  });
  </code></pre>
  
  <p>What I'd like to do is something like:</p>
  
  <pre><code>my_array = [
    {key: 1, value: "foo"},
    {key: 2, value: "bar"},
  ];
  
  const my_obj = ...?
  </code></pre>
  
  <p>Is there a way to do a one-shot conversion that's equivalent to the <code>forEach</code> call?</p>