title: For Loop Max JavaScript
body: <p>I have just created a prime number finder with a for loop that runs over time.  Right now its at 167899 and growing every second.</p>
  
  <p>What is the max number of loops a for loop can go through???    If its an ungodly big number I don't want to be waiting all night to see what is the max prime number I can generate.</p>
  
  <p>Is it infinite?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>        var isNotPrime = false;
          var currentNumber = 3;
          var primeArray = [2];
  
          function prime(){
              isNotPrime = false;
              for(a=0; a&lt;primeArray.length; a++){
                  if(currentNumber%primeArray[a] === 0){
                      isNotPrime = true;
                  }
                  if(a===(primeArray.length-1) &amp;&amp; isNotPrime ===false){
                          document.write(currentNumber+"&lt;BR&gt;");
                          primeArray.push(currentNumber);
                  }
                  if(a===(primeArray.length-1)){
                      currentNumber++;
                  }
              } 
          }
  
          var main = setInterval(prime, 1);
  
          window.alert("Starting search for Prime Numbers!");
  </code></pre>