title: Why does this loop terminate partway through?
body: <p>I'm trying to write a program to find the smallest common multiple of the provided parameters that can be evenly divided by both, as well as by all sequential numbers in the range between these parameters.</p>
  
  <p>The range will be an array of two numbers that will not necessarily be in numerical order.</p>
  
  <p>For example, for 1 and 3 - find the smallest common multiple of both 1 and 3 that is evenly divisible by all numbers between 1 and 3.</p>
  
  <p><strong>Why does the loop stop at i = 510,000 (or something close to that) instead of 7,000,000, as I set it?</strong></p>
  
  <p>I also have a screenshot with the output:</p>
  
  <p><a href="https://i.stack.imgur.com/sgCgV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sgCgV.png" alt=""></a></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>function smallestCommons(arr) {
    
    var start;
    var finish;
    var something;
    
    if(arr[0] &lt; arr[1]){start = arr[0]; finish = arr[1];}else{
        start = arr[1]; finish = arr[0];
      }
    
    for(var i = finish;i &lt;= 7000000;i++){
      var boolea = true;
      for(var j = start;j &lt;= finish;j++){
        if(i % j !== 0){boolea = false;break;} // 2 % 1
      }
      
      if(boolea)return i;
      
      something = i;
    }
    
    console.log("final i = " + i);
    
    return 0;
  }</code></pre>
  </div>
  </div>
  </p>