title: How run async / await in parallel in Javascript
body: <p>Finally <code>async</code>/<code>await</code> will be <a href="http://kangax.github.io/compat-table/es2016plus/#test-async_functions" rel="noreferrer">supported</a> in all major browser soon except IE.
  So now we can start writing more readable code with <code>async</code>/<code>await</code> but there is a catch. A lot of people use async await like this:</p>
  
  <pre><code>const userResponse = await fetchUserAsync();
  const postsResponse = await fetchPostsAsync();
  </code></pre>
  
  <p>While this code is readable it has a problem, it runs the functions in series, it won't start fetching posts until the fetching of the user is finished. The solutions is simple, we need to fetch the resources in parallel.</p>
  
  <p>So what I want to do is (in pseudo language): </p>
  
  <pre><code>fn task() {
    result-1 = doAsync();
    result-2 = doAsync();
    result-n = doLongAsync();
  
    // handle results together
    combinedResult = handleResults(result-1, result-2);
  
    lastResult = handleLastResult(result-n);
  }
  </code></pre>