recursively_sum.js 99 B

123
  1. const sum = number => number > 0 ? number + sum(number - 1) : number;
  2. console.log(sum(5)); // 15