I am trying to write an algorithm to calculate the sum of prime numbers less than or equal to a given number argument. Here is my code:
function sumPrimes(num