Tell us what’s happening:
Here is my code for summing prime numbers up to a given number but its not passing the tests and I don’t understand why. Please help
Your code so far
function sumPrimes(num) {
var sums = 0;
for(var i = 2; i <= num; i++);
if(isPrime(i)){
return sums += i;
}
return sums;
}
sumPrimes(10);
Your browser information:
User Agent is: Mozilla/5.0 (Linux; Android 8.1.0; CPH1909 Build/O11019) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36.