Don't understand the result of Promise API
<p>I'm trying to get my head around the Promise API, and struggling. </p>

<p>This is what I've tried so far:</p>

<pre><code>const myPromise = () =&gt; {
   return new Promise( (resolve, reject) =&gt; {
      var name = 'John'
      if (name === 'John') {
         resolve(name)
      }
      else reject('Anonymous')
   })
}
</code></pre>

<p>Then when I <code>console.log(myPromise())</code>, I get...</p>

<pre><code>Promise {[[PromiseStatus]]: "resolved", [[PromiseValue]]: "John"}
</code></pre>

<p>I would expect to get <code>John</code> back from this. As it stands, I don't know how to handle the data. Can anyone point out where I'm going wrong?</p>