title: Javascript - Largest prime factor of a number
body: <p>I'm currently doing the Project Euler challenges using javascript.
  I'm doing the third challenge which involves finding the largest prime factor of a number, and my code works according to the example, but when I try to do a much larger number, the code ends up freezing?</p>
  
  <pre><code>//Functions
  function PrimeChecker(Number){
  //Variables
  var Counter = 2;
  //Check Number
      do{
          if(Number % Counter == 0){
                  if(Counter == Number){
                      return true;
                      break;
                  }
              return false;
              break;
          }
          else{
              Counter++;  
          }
      }while(Counter != Number+1);
  }
  
  function FactorChecker(Number){
  //Variables
  var Counter = Number;
  //Check Prime
  do{
      console.log("Count: "+Counter);
      if(Counter==Number){
          //Nothing
      }else{
              if(PrimeChecker(Counter) == true){
                  if(Number%Counter==0){
                      console.log("Pass with: "+Counter);
                      break;
                  }
                  else{
                      console.log("Undivisable with: "+Counter);
                  }
              }
          }
      Counter--;
      }while(true);
  }
  
  //End
  FactorChecker(600851475143);
  </code></pre>
  
  <p>Before it crashes, the final output that it gives is <code>Count: 600851475067</code></p>