title: Return value from Promise then callback function
body: <p>In the following code:</p>
  <pre><code>function getPosition() {
      return new Promise((res, rej) =&gt; {
          navigator.geolocation.getCurrentPosition(res, rej);
      });
  }
  
  function main() {
      getPosition().then(console.log);
  }
  
  main();
  </code></pre>
  <p>I'm able to log the Position object in the browser. But what if instead of logging it I want to return that value so that it can be used <strong>outside of the then()</strong>. Is that possible?</p>
  <p>I tried the following:</p>
  <pre><code>function main() {
      return getPosition().then();
  }
  
  console.log(main());
  </code></pre>
  <p>But instead of viewing my Position object in the log, I see the following:</p>
  <pre><code>Promise {&lt;pending&gt;}
  __proto__: Promise
  [[PromiseStatus]]: &quot;resolved&quot;
  [[PromiseValue]]: Position
  </code></pre>
  <p>This doesn't work either</p>
  <pre><code>function main() {
      getPosition().then(function(response){
          return response;
      });
  }
  
  console.log(main());
  </code></pre>
  <p>I got <strong>undefined</strong> in the log.</p>