**Hello, I think my code is correct and the result expected is wrong**

because the sum of prime numbers under 10 is 18 not 17

```
**My code so far**
```

```
function sumPrimes(num) {
let primeArr = [];
let isPrime = function(x) {
let inc = 0;
for (let i=0; i <= x; i++) {
if (x % i ==0) {
inc++;
if(inc > 2) {return false}
}
}
return true;
}
for (let y= 1; y<=num; y++) {
if(isPrime(y)) {
primeArr.push(y);
}
}
console.log(primeArr.reduce((a,b) => a+b));
return num;
}
sumPrimes(10);
```

```
**Your browser information:**
```

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0`

**Challenge:** Sum All Primes

**Link to the challenge:**