Hello I was wondering if anyone could help shed light on a issue I’ve been having with my code for the sum all primes exercise. The below effectively doesn’t filter for primes and returns 54

```
function sumPrimes(num) {
var primeSeed = []
for (let i = 2; i <= num; i++){
primeSeed.push(i)
}
var optimusPrime = primeSeed.filter(item => {
let i = item -1
while(i > 1 && i >= Math.sqrt(item)){
if(item % i == 0){
return false;
i--
}}
return true;
})
.reduce((a, b) => a + b)
return optimusPrime
}
sumPrimes(10);
```

But when the braces are removed from the if statement under the while it runs fine ie. this returns 17

```
function sumPrimes(num) {
var primeSeed = []
for (let i = 2; i <= num; i++){
primeSeed.push(i)
}
var optimusPrime = primeSeed.filter(item => {
let i = item -1
while(i > 1 && i >= Math.sqrt(item)){
if(item % i == 0)
return false;
i--
}
return true;
})
.reduce((a, b) => a + b)
return optimusPrime
}
sumPrimes(10);
```

Can anyone help me understand why this is?

Thanks!