title: Javascript async function is waiting for response without await
body: <p>I am new to the concept of JavaScript's asynchronous behavior.</p>
  
  <p>The below code is confusing me. According to my concept function b should return before the wait function finishes executing because I am not telling it wait using 'await'.
  But the output I am getting is this : 
  before
  <strong><em>then it waits for 6 seconds</em></strong>
  after
  after b</p>
  
  <p>expected output : 
  before
  after
  after b
  <strong><em>without waiting for 6 seconds</em></strong>
  Here is the code : </p>
  
  <pre><code>function wait(ms)
  {
  
    var start = new Date().getTime();
  
    var end = start;
  
    while(end &lt; start + ms) {    
  
      end = new Date().getTime();
  
      }
  }
  
  async function b () {
    console.log('before');
    wait(6000);
    console.log('after');
  }
  
  async function c () {
  b()
  console.log('after b');
  }
  
  c();
  </code></pre>
  
  <p>Please help me understand this concept better</p>