**

## !SPOILERS AHOY!

**

This is in regards to the ‘Sum All Primes’ intermediate algorithm, which asks you to write a function that sums all primes up to the given number.

My code looks like it’s returning the correct sums for all the primes that I’ve fed to it… *except* for the final test number, which is 977!

Could anyone take a look and explain to me why my code seems to work only up to a certain point? Thanks in advance!

function sumPrimes(num) {

var sum = 5;

var current = 3;

while(current < num){

current+=1;

if(current%2!==0 && current%3!==0){

sum+=current;

}

}

return sum;

}