hi, I think I have a misunderstanding for the for loop or there is a technical issue. here are 2 pieces of code where fol loop is considered an infinite loop and I don’t know why

1 -

```
function sumPrimes(num) {
var nums = [2];
var ss =[];
// Not to add all numbers , but add only Primes in the Nums Array by checking if the added number / every number in the Nums array addd before it isn't out of 1 and the number itself
for (var i = 3 ; i <= num ; i++){
for (var j = 0 ; j < nums.length; j++){
var di = i / nums[j];
if (di !== Math.floor(di)){
nums.push(i) ;
}
}
//nums.push(i);
}
var res = nums.reduce(function (a,b){return a+b;},0);
return nums;
}
sumPrimes(20);
```

2-

```
function sumFibs(num) {
var fiboNums = [1,1];
var firstFibo = 1 ;
var secondFibo = 1 ;
var sum = firstFibo + secondFibo;
fiboNums.push(sum);
for ( var i = 0 ; i < num ; i++){
/* 1 + 1 == 2 ;
1 + 2 == 3
2 + 3 == 5
3 + 5 == 8*/
sum = sum + secondFibo;
fiboNums.push(sum);
}
return fiboNums;
}
sumFibs(4);
```