**Tell us what’s happening:**

I don’t understand why it doesn’t work. I used the sieve of Eratosthenes.

Thank you.

**Your code so far**

```
function sumPrimes(num) {
var primes = [];
var sum = 0;
for(var i = 2; i < num; i++) {
primes[i] = true;
}
var limit = Math.sqrt(num);
for(var i = 2; i < limit; i++){
if(primes[i] === true){
for(var j = (i * i); j < num; j+=i){
primes[j] = false;
}
}
}
for(var i = 2; i <= num; i++){
if(primes[i] === true) sum += i;
}
return sum;
}
sumPrimes(977);
```

**Your browser information:**

Your Browser User Agent is: `Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36`

.

**Link to the challenge:**