I have to calculate compound profit.
for example, I have $100, increasing 10% monthly, and I have to calculate the total profit for 12 months. And I need a profit of every month in an array.
I have tried this
let capital = 100;
let month = 12;
let profit_percentage = 10;
let total_profit;
for (i = 0; i <= month; i++) {
total_profit = capital + (profit_percentage / 100) * 100;
console.log(total_profit);
}