title: Wait for few seconds before next action - Javascript
body: <p>As commented in the code , I need a wait before checking the <code>else if</code> after <code>writeFile(lFileData);</code>. How to achieve this?</p>
  
  <pre><code>for(var i=0;i&lt;mLocalStorageCount;i++)
          {
  
              if(i &lt;= 1)
              {
  
                  writeFile(lFileData); //This action takes a lot of time with its call backs. I need a wait here. 
  
              }
  
              else if(i &gt; 1 &amp;&amp; i &lt;=3)
              {
                       someOtherfun()
  
              }
  </code></pre>