title: Javascript async function basic
body: <p>First of all I am new to <code>async</code> functions. Where is the problem in this code? I just get <code>test 1</code> and <code>test 2</code> output.</p>
  
  <pre><code>let isAvailable = false;
  
  console.log('test1');
  
  let asynchFunc = () =&gt; {
     return new Promise(() =&gt; {
         if (isAvailable === true) {
             console.log('here asyncFunc');
         }
     });
  }
  
  (async () =&gt; {
     await asynchFunc();
  });
  
  console.log('test2');
  
  isAvailable = true;
  </code></pre>