Sum All Primes, right answers, won't pass

code outputs answer, but won’t register as a pass :confused:

Your code so far

function isPrime(num) { 
  var all = []; 
  for (var count = 0; count <= num; count++){ 
    all.push(count);} 
  
  all = all.filter(function(number) {
    for (var i = 2; i <= Math.sqrt(number); i++) { 
      if (number % i === 0) return false; }
    return true; }); 
 
  return all.slice(2, all.length -0).reduce(function(a, b){ 
    return a + b; 
  });   
} 

isPrime(10);```
firefox


Your Browser User Agent is: ```Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0```.

**Link to the challenge:**
https://www.freecodecamp.org/challenges/sum-all-primes

Wow! Thank you so much!

I never would have guessed that you can’t change the function name. I rewrote that code so many times, I can’t even remember why I renamed it…

Thank you Thank you Thank you!

I think that is exactly what I did. :slight_smile:

Thank you! That does simplify things. :slight_smile: