What value is obtained when executing the following code?
function summation(n) {
if (n === 1) {
return 1;
}
return n + summation(n - 1);
}
console.log(summation(3));
What value is obtained when executing the following code?
function summation(n) {
if (n === 1) {
return 1;
}
return n + summation(n - 1);
}
console.log(summation(3));