title: async function - await not waiting for promise
body: <p>I'm trying to learn async-await. In this code - </p>
  
  <pre><code>const myFun = () =&gt; {
      let state = false;
  
      setTimeout(() =&gt; {state = true}, 2000);
  
      return new Promise((resolve, reject) =&gt; {
          setTimeout(() =&gt; {
              if(state) {
                  resolve('State is true');
              } else {
                  reject('State is false');
              }
          }, 3000);
      });
  }
  
  const getResult = async () =&gt; {
      return await myFun();
  }
  
  console.log(getResult());
  </code></pre>
  
  <p>why am I getting output as -</p>
  
  <pre><code>Promise { &lt;pending&gt; }
  </code></pre>
  
  <p>Instead of some value? Shouldn't the <code>getResult()</code> function wait for <code>myFun()</code> function resolve it's promise value?</p>