title: How to pause javascript code execution for 2 seconds
body: <p>I want to stop execution for 2 seconds. So is this, but now follows a code block:</p>
  
  <pre><code>&lt;html&gt;
     &lt;head&gt;
        &lt;title&gt; HW 10.12 &lt;/title&gt;
        &lt;script type="text/javascript"&gt;
           for (var i = 1; i &lt;= 5; i++) {
               document.write(i);
               sleep(2); //for the first time loop is excute and sleep for 2 seconds        
           };
        &lt;/script&gt;
     &lt;/head&gt;
     &lt;body&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>For the first time loop is excute and sleep for 2 seconds. I want to stop execution for two seconds?</p>