title: Javascript 'For' loop debugging BEGINNER
body: <p>I'm learning JavaScript and need help in making this work. I believe the <code>for loop</code> is the issue but I don't understand. This is just making my browser freeze up. </p>
  
  <pre><code>var formatNumber = function(num, type) {
  
     var numSplit, int, dec;
  
     num = Math.abs(num);
     num = num.toFixed(2); 
     numSplit =  num.split('.');
     int = numSplit[0];
  
     **if (int.length &gt; 3) {
      for (var i = 3; i &lt; int.length; i + 4) {
          int = int.substr(0,int.length - i) + ',' + int.substr(int.length - i, int.length);
          }
      };** 
  
  
     dec = numSplit[1];
  
  
     return (type === 'exp' ? sign = '-' : sign = '+') + '' + int + dec;
  
  };
  </code></pre>