title: How do promise chains start and finish
body: <p>I'm a little confused about how the sequencing works in various documents I've come across. For instance, I have seen this sort of thing</p>
  
  <pre><code>let p = Promise.resolve();
  for (let x in something)
  {
      /* do some hairy time consuming code */
      p = p.then(dosomething(x));
  }
  return p.then(finalthing()).catch(pretendnobadthing());
  </code></pre>
  
  <p>What I really don't understand is that if you do something that takes a large amount of time in the main code, wouldn't that mean that one of the promises could complete before the main code actually got round to to setting up the .then. </p>
  
  <p>Can you always use .then/.catch on a promise, and if its already reached completion, it'll carry on from the point it got to, so it conceptually looks like a big chain that will run to completion at some indeterminate point? And if so, doesn't that mean every time you create a promise chain it'll hang about for ever?</p>