I tried solving this problem using recursion and I dont understand one thing about recursions…

To callback on the function **checkPrime(),** how come I need to add **return**?

How come the function doesn’t call back on itself without the **return**?

The function **sumPrimes**() already has a **return checkPrime**() to call the function and the function **checkPrime**() has a **return sum** that should end the function with the sum.

Why does **checkPrime(num-1)** need a **return** in the front?

**Tell us what’s happening:**

Describe your issue in detail here.

```
**Your code so far**
```

```
function sumPrimes(num) {
var sum = 0;
function checkPrime(num) {
if (num<=1) {
return sum
}
for (let i=2; i<num; i++) {
if (num % i === 0) {
return checkPrime(num-1)
}
}
sum += num
return checkPrime(num-1)
}
return checkPrime(num)
}
sumPrimes(10);
```

```
**Your browser information:**
```

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36`

**Challenge:** Sum All Primes

**Link to the challenge:**