function sumPrimes(num) {
if (num > 1){
let sum = 0;
// Loop through each element from 2 to num
for (let i = 2; i <= num; i++) {
let count = 0;
// Loop through numbers from 1 to i, and count the divisors
for (let j = 1; j <= i; j++) {
if (i % j === 0) {
count ++;
}
}
// If the divisors count is more than 2, that means it is not a prime number
//If the count is equal to 2, then it is a prime number
if (count === 2) {
sum = sum + i;//add the prime number to the sum
}
}
return sum;}
}

Hey, thanks for the enthusiasm and desire to submit new official solutions.

This is a particularly inefficient solution, which is similar to some of the other solutions, so I donâ€™t know that this solution helps future campers a lot.

You can use techniques like discussed in this post (below) to measure performance.