Sum Primes returned values

Tell us what’s happening:

Im getting the expected output but the test wont confirm it

Your code so far

function sumPrimes(num) {

function checkPrime(num){
  if(num == 2 ) return true;
  if(num == 1 ) return false;
  for(let i=2; i<num; i++){
    if(num%i == 0){
      return false;
  return true;

let sum = 0;

for(let i=1; i<=num; i++ ){
    sum += i;

return num;


Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36.

Challenge: Sum All Primes

Link to the challenge:

This is a small problem. Fix this and you’re all set!