**Tell us what’s happening:**

**Your code so far**

```
function sumPrimes(num) {
let count = num / 2-1;
let arr = [];
let sum = 0;
for (let i = 2; i < num; i++) {
arr.push(i)
}
while (count !== 1) {
for (let i = 0; i < arr.length; i++) {
if (arr[i] !== 0 && arr[i] !== count) {
if (arr[i] % count === 0) {
arr[i] = 0
}
}
}
count--;
}
for (let i = 0; i < arr.length; i++) {
if(arr[i] != 0) {
sum += arr[i];
}
}
return sum
}
console.log(sumPrimes(977));
```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36`

.

**Link to the challenge:**

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-primes