1const recursiveEvenSum = (num, sum = 0) => {
2 num = num % 2 === 0 ? num : num - 1;
3 if(num){
4 return recursiveEvenSum(num - 2, sum+num);
5 }
6 return sum;
7};
8console.log(recursiveEvenSum(12));
9console.log(recursiveEvenSum(122));
10console.log(recursiveEvenSum(23));
11console.log(recursiveEvenSum(10));
12console.log(recursiveEvenSum(19));