title: What is the purpose of the parameter to the function inside the then function while using async in javascript?
body: <pre><code>async function testAsync() {
    return 'Hello Adam!.';
  }
   
  const any = testAsync();
   
  console.log(any.then((msg) =&gt; {console.log(msg)}));
  </code></pre>
  <p>I am a complete beginner to JavaScript and trying to understand how <code>async</code> function works. I just don't understand the purpose of <code>msg</code> parameter and how logging that prints the return value.</p>