Recursividad
Anonymous
javascript
05/17/2021 6:08 PM
136 B
18
Indexable
function sum(arr, n) {
if( n<=0) {
return n ;
} else {
return sum(arr, n-1) + arr[n-1]
}Editor is loading...
function sum(arr, n) {
if( n<=0) {
return n ;
} else {
return sum(arr, n-1) + arr[n-1]
}