title: Does the execution of an infinite loop in javascript tax only your computer's resources?
body: <p>I'm beginning to learn javascript and I wrote an infinite loop</p>
  
  <pre><code>&lt;script&gt;
  while(1==true){
      document.write("hello world");
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I ran <code>top -d .5</code> from the commandline and didn't see this script take up CPU.</p>
  
  <p>I then created an infinite loop in .php </p>
  
  <pre><code>&lt;?php
      while(1==true){
          echo "Hello World";
      }
  ?&gt;
  </code></pre>
  
  <p>I ran <code>top -d .5</code> from the commandline and saw this .php script take up CPU.</p>
  
  <p>This leads me to believe that when an infinite loop written in javascript runs, it only taxes your computer's resources, not the server's (I guess that's why they call it a client-side language.)  Can someone confirm this?</p>
  
  <p>And more generally, does this mean that all the interpreting of javascript taxes only your computer's resources, not the server's?</p>