title: Having trouble implementing promises with setTimeout and running them in parallel
body: <p>I am trying to write a function that would returns an asynchronous promise. Using a <code>setTimeout</code> of 100ms to simulate promise resolve, except for G(one of the promises) it's <code>setTimeout</code> is 200ms. Each step is separate asynchronous promise.</p>
  
  <p>I want each promise to start after the previous step has completed.
      All promises log their names &amp; income parameters to console and provide name as a result to next promises.
      Basic flow :
      a -> (b + c + d) -> e -> f -> h -> i -> j
                           `->   g  ->  /</p>
  
  <p>Here:
      (b+c+d) - means that 3 promises should be running in parallel
      'i' waits for both g &amp; h.
      Results from each previous task should be provided to next task.</p>
  
  <pre><code>var promise = new Promise(function(resolve, reject)) {
      setTimeout(resolve, 100);
  });
  
  Promise.all([promise.resolve(a), promise.resolve(b+c+d), promise.resolve(e), promise.resolve(f), promise.resolve(g)...]).then(function(values) {
      console.log(values);
  });
  </code></pre>