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

**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
```