title: Why is value undefined at .then() chained to Promise?
body: <p>Given</p>
  
  <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>function doStuff(n /* `n` is expected to be a positive number */) {
    return new Promise(function(resolve, reject) {
      setTimeout(function() {
        resolve(n * 10)
      }, Math.floor(Math.random() * 1000))
    })
    .then(function(result) {
      if (result &gt; 100) {
        console.log(result + " is greater than 100")
      } else {
        console.log(result + " is not greater than 100");
      }
    })
  }
  
  doStuff(9)
  .then(function(data) {
    console.log(data) // `undefined`,  why?
  })</code></pre>
  </div>
  </div>
  </p>
  
  <p>Why is <code>data</code> <code>undefined</code> at <code>.then()</code> chained to <code>doStuff()</code> call?</p>