Faulty with large numbers.

**Your code so far**

```
function sumPrimes(num) {
let sum = 0;
let prhyme = [];
for (let i = 2; i<=num; i++){
let flag = 0;
for(let j = 1; j<=i; j++){
if(i%j === 0){
flag++;
}
}
if(flag === 2){
prhyme.push(i);
}
}
sum = prhyme.reduce((x1, x2) => (x1+x2));
return sum;
}
sumPrimes(10);
```

**Your browser information:**

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

.

**Link to the challenge:**

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