letvalues=[amount];// we start with the initial amount in the array
for(letyear=1;year<=years;year+=1){
// for each year, we calculate the compounded value and append it to the array
values.push(compounding(year));
}
returnvalues;
}
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.