I procrastinated most of my day, but I was able to get back on the horse and work through this (my entire evening haha)
Usually i overwrite and comment, but I was able to spot my failing logic and pass the challenge - it can be further condensed im sure but here it is for now
function sumPrimes(num) {
let myArr = [];
let count = 0;
for(let i =2; i<=num; i++){//all numbers 0 thru NUM
//console.log("outer loop, index is", i);
myArr.push(i);
for(let n=2; n<=num; n++){//all numbers 2-NUM
// console.log(i%n===0, "n is ", n);
if(i%n === 0 && i>n){
console.log(i, ", there is a remainder! it is divisble!");
count=1;
if(myArr.indexOf(i) > 0 && count>0){
count=0;
//console.log(myArr);
myArr.pop();
console.log(myArr);
}
}//if
};//inner loop
};//outer loop
console.log("_ _f i n a l_ _ _ _a r r ay_ _ i s_ _, ".toUpperCase(), myArr);
let addPrimes = myArr.reduce((a,b)=> a+b);
return addPrimes;
return num;
}
console.log(sumPrimes(10));