title: Promise { <pending> } ' why is it still pending?' How can I fix this?
body: <p>So the result in the console shows as - </p>
  
  <pre><code>Promise { &lt;pending&gt; } ' why is it still pending?'
  [ { _id: 5a7c6552380e0a299fa752d3, username: 'test', score: 44 } ]
  </code></pre>
  
  <p>So it tells me Promise { pending } but then follows with the answer that I wanted to see which is - </p>
  
  <pre><code>[ { _id: 5a7c6552380e0a299fa752d3, username: 'test', score: 44 } ]
  </code></pre>
  
  <p>but how can I fix that promise pending section, it's a console.log that I run at the bottom of the code. </p>
  
  <pre><code>function resolveAfter1() {
    return new Promise((resolve, reject) =&gt; {
      var scoresFromDb = db.account.find({}, { username: 1, score: 1 }).toArray(function(err, result) {
            if (err) 
                reject(err);
            else
                resolve(result);
      });
    });
  }
  
  resolveAfter1() // resolve function
      .then((result)=&gt;{console.log(result);})
      .catch((error)=&gt;{console.log(error);})
  
      async function asyncCall() {
        var result = await resolveAfter1();
        // console.log(result);
      }
  
      console.log(asyncCall(), ' why is it still pending?');
  </code></pre>