Sum All Primes please help

Tell us what’s happening:
Please any help how to fix this! How to give me the right number when i check 977?

Your code so far

function sumPrimes(num) {
  var numb = [];
  var last = [2];
for(var i = 1; i< num; i++){
  for(var x = 2; x< numb.length; x++){
     if(x%2 == 1){
  return last;


Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36.

Link to the challenge:

What you’re doing is putting the primes into an array and returning the array object.

What you need to do instead is add the prime numbers and return the total, in the form of a number (or variable with a number value).

Yes i know, but when i sum 977 the return is not correct. i used .reduce() to sum the numbers. The problem here is the function doesn’t return the right numbers.