title: order of execution of node JS timer APIs
body: <p>I am very new to node.js. Am trying to understand what exactly is meant by 'asynchronous' in terms of node js. </p>
  
  <p>In the above context I have the below code:- </p>
  
  <pre><code>function foo()
  {
    setImmediate(function two()
    {
      console.log(1);
    });
    setTimeout(function one()
    {
      console.log(3);
    },0);
    process.nextTick(function three()
    {
      console.log(2);
    });
    console.log(4);
  }
  foo();
  </code></pre>
  
  <p>can some one please explain me, in depth, as to what exactly would be the order of execution for all of the above timer APIs and WHY will it be so? Any explanations/references regarding the call back stack etc. will also be helpful.</p>