title: how to create a custom asynchronous function in node.js
body: <p>Ii'm trying to do something like.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function fun1(){
    for(var j=0;j&lt;20;j++)
    {
      var n = j;
      console.log("i= "+n);
    }
  }
  function fun2()
  {
    console.log("In Callback");
  }  
  
  fun1();
  fun2();</code></pre>
  </div>
  </div>
  </p>
  
  <p>its working fine till now and got output as expected.</p>
  
  <p>But, I want to call function <code>fun1()</code> and <code>fun2()</code> asynchronously it means <code>fun2()</code> call before <code>fun1()</code>, b'coz <code>fun1()</code> will take some time for complete the execution as compare to <code>fun2()</code>.</p>
  
  <p>How can I achieve this, Node.js provide asynchronous function, Is it already defined function can asynchronous only or we can make them according our need. </p>