title: On `Promise` and `then()` execution order
body: <p>Let's say I have a function like this</p>
  
  <pre class="lang-js prettyprint-override"><code>const fn = () =&gt; {
      return work()
      .then((finalResult) =&gt; {     // then 1
          finish(finalResult);
      });
  };
  
  
  const work = () =&gt; {
      return Promise.resolve(1)
      .then(() =&gt; {                // then 2
          return process1();
      }).then((result) =&gt; {        // then 3
          return process2(result);
      });
  };
  </code></pre>
  
  <p>My question is: can I rely on the fact that <code>finish</code> will be called AFTER <code>process1</code> and <code>process2</code>. Specifically, is <code>then 1</code> attached to the promise returned by <code>Promise.resolve(1)</code> or is it attached to the promise returned by <code>then 3</code>.</p>