I'm trying to solve a mathematical problem from <http://projecteuler.net> using javascript: to find the sum of all the primes below two million. When I run the script I wrote, my browser crashes (I'm using Google Chrome). This is the script:

```
function isPrime(num) 
{ 
    if(num < 2) 
    return false; 
    for (var i = 2; i < num; i++) 
        { 
        if(num%i==0) 
        return false; 
        } 
return true; 
} 
var total=0e1;
    for (var i = 1; i < 2000000; i++)
        { 
        if(isPrime(i)) 
            {
            total=total+i;
            }
        } 

document.write("The sum of all the primes below two million is ",total);

```

The script works fine for smaller numbers (i<100000). What is wrong with it? How can I fix it? Thanks for your help.