Question: I am trying to do an exercise from here <https://www.w3resource.com/javascript-exercises/javascript-recursion-function-exercise-7.php>

I understand the solution, however, I am kind of curious why my program does not yield the same answer as above. The way I choose the return the function is slightly different, however, it yields a number instead of true or false.

```js
function checkeven(num) {
    if (num === 0) {
        return true;
    } else if (num === 1) {
        return false;
    } else {
        console.log(num);
        return num - checkEven(num - 2);
    }
}

console.log(checkeven(8));
console.log(checkeven(9));
```

Answer: 
You can do:

```js
odd = function(n) {if (n%2 == 0) {return true} else {return false;}}

console.log(odd(8));
console.log(odd(5));
```

or:

```js
checkeven = function(num) {
    if (num === 0) {
        return true;
    } else if (num === 1) {
        return false;
    } else {
        return checkeven(num - 2);
    }
}

console.log(checkeven(8));
console.log(checkeven(9));
```
You can also use the modulo operator, so you don't even need recursion

```
const areYouEven = n => !(n % 2)

```