My solution works for the first 2 test but not the third. Any hints on what is going wrong? Thanks!

```
function sumPrimes(num) {
let arr = [2];
let i = 3;
while (i <= num) {
arr.push(i);
i++;
}
let arr2 = arr.filter(n => n % 2 ===0 && n > 2);
let arr3 = arr.filter(n => n % 3 ===0 && n > 3);
let arr5 = arr.filter(n => n % 5 ===0 && n > 5);
let arr7 = arr.filter(n => n % 7 ===0 && n > 7);
let nonprimeArr = arr2.concat(arr3, arr5, arr7);
let primeArr = arr.concat(nonprimeArr)
.filter(el =>
arr.indexOf(el) === -1 ||
nonprimeArr.indexOf(el) === -1);
console.log(primeArr);
return primeArr.reduce((a, b) => a + b, 0);
}
sumPrimes(977);
```