title: Understanding NodeJs await with setTimeout() method
body: <p>I'm fairly new to NodeJs and understanding the concept of async/await. Please correct me if I'm wrong - <strong>await keyword blocks the code until it gets a resolved value</strong>. For example:  </p>
  
  <pre><code>const sampleFunction = async () =&gt; {
        const result = await someAsynFunctionReturningPromise();
        console.log('Log is printed here!');
  }  
  </code></pre>
  
  <p>In the above code, the compiler stops the code at 'const result = await someAsynFunctionReturningPromise();' until 'someAsynFunctionReturningPromise()' gets resolved, right?  </p>
  
  <p>With the above assumption, I tried the below setTimeout() code:  </p>
  
  <pre><code>const sampleFunction = async () =&gt; {
    const result = await setTimeout(()=&gt;{
          console.log('This is printed after 2 seconds');
    },2000);
    console.log('Log is printed here!');
  }    
  </code></pre>
  
  <p>However, the above code doesnt await till setTimeout() is resolved, it skips to the next line, printing 'Log is printed here!'.  </p>
  
  <p>Can anyone please help me understand if my understanding is wrong?</p>