title: Some strange when using Promise in JavaScript
body: <p>I have a function that returns a promise object. This is my code</p>
  
  <pre><code>var foo = function(){
      // doSomething() is a promise object
      return doSomething().then(() =&gt; {
          Promise.resolve('Hello');
      });
  };
  
  foo().then((res) =&gt; {
      console.log(res);
      // res = undefined but not "Hello"
  });
  </code></pre>
  
  <p>I thought function <code>foo</code> would return the promise object and I would get the string "Hello". But I get undefined. Why?</p>