title: Why is promise resolving with undefined?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var firstPromise = new Promise((resolve, reject) =&gt; {
    resolve('first promise');
  });
  
  firstPromise.then(() =&gt; {
    return new Promise((resolve, reject) =&gt; {
      resolve('second promise');
    }).then((result) =&gt; {
      console.log('hello');
    });
  }).then((result) =&gt; {
    console.log(result);
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>I know this is not the best way to write this promise chain, but I was wondering why the last <code>.then</code> executes at all. I'm not returning anything with <code>console.log('hello')</code>, so wouldn't the .then off of the second promise never resolve?</p>