This is what I've got
let base = 10000
let yearly = 31557600
let apy = 0.09
let loop = 0;
let new_base = '0';
function recurse(base){
new_base = base*(1+apy*1/(yearly));
if(loop < 3600){
loop++;
return recurse(new_base);
}
else {
return new_base;
}
}
base = recurse(base);
console.log(base);
if I change 3600 by a very large number I get the error: Maximum call stack size exceeded
This seems normal to me because the recursive operation is executed too many times,
what would be the solution ? Is it possible to transform the recursive function into a linear function for example?
Thanks

for(let i = 0; i < 3600; i++){new_base = new_base *(1+apy*1/(yearly));}