title: Multithreading in JavaScript?
body: <p>I have the next sample of code in JavaScript:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var i = 0;
  
  async function asyncFunction() {
    i++;
    document.write(i + "&lt;br/&gt;");
  }
  
  for (var j = 0; j &lt; 1000; j++) {
    asyncFunction();
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The Output in The Google Chrome is:</p>
  
  <pre><code>1
  2
  3
  4
  ...
  1000
  </code></pre>
  
  <p>It isn't:</p>
  
  <pre><code>1
  3
  2
  4
  ...
  1000
  999
  </code></pre>
  
  <p>I am using The Google Chrome and It's always syncronius. When Is It planned be able?</p>