title: JavaScript - Project Euler #5 -- efficiency
body: <p>This is for Project Euler, problem #5. </p>
  
  <p>The task is to find the smallest number evenly divisible by numbers 1-20. My code seems to work on 1-18, but at 19 my browser starts timing out. This leads me to believe my code is just inefficient. </p>
  
  <p>How can I mitigate this?</p>
  
  <pre><code>function divisible(a){
      counter = 0;
      result = 2;
      while (counter &lt; a){
          for (var x = 0; x &lt;= a; x ++){
              if (result % x === 0){
                  counter ++;
              }
          }
          if (counter != a){
              counter = 0;
              result ++;
          }
      }
      return result;
  }
  divisible(20)
  </code></pre>