title: Async / await assignment to object keys: is it concurrent?
body: <p>I know that doing this:</p>
  
  <pre><code>const resultA = await a()
  const resultB = await b()
  // code here
  </code></pre>
  
  <p>Is effectively</p>
  
  <pre><code>a().then( resultA =&gt; {
     b().then( resultB =&gt; {
        // code here
     })
  })
  </code></pre>
  
  <p>Basically, a() runs <em>then</em> b() runs. I nested them to show that both resultA and resultB are in our scope; yet both function didn't run at once. </p>
  
  <p>But what about this:</p>
  
  <pre><code>const obj = {
    result1: await a(),
    result2: await b()
  }
  </code></pre>
  
  <p>do a() and b() run concurrently?</p>
  
  <p>For reference:</p>
  
  <pre><code>const asyncFunc = async (func) =&gt; await func.call()
  const results = [funcA,funcB].map( asyncFunc )
  </code></pre>
  
  <p>I know here <code>funcA</code> and <code>funcB</code> do run concurrently. </p>
  
  <p><strong>Bonus</strong>:</p>
  
  <p>How would you represent the object assignment </p>
  
  <pre><code>const obj = {
    result1: await a(),
    result2: await b()
  }
  </code></pre>
  
  <p>using <code>then</code> / callbacks?</p>
  
  <hr>
  
  <p>UPDATE:</p>
  
  <p>@Bergi is correct in this answer, this occurs sequentially. To share a nice solution for having this work concurrently for an object without having to piece together the object from an array, one can also use <code>Bluebird</code> as follows</p>
  
  <pre><code>const obj2 = Bluebird.props(obj)
  </code></pre>
  
  <p><a href="http://bluebirdjs.com/docs/api/promise.props.html" rel="noreferrer">http://bluebirdjs.com/docs/api/promise.props.html</a></p>