0

I wrote a program that calculates the compound interest and I want it to be displayed in the console as a table, but I don't need the index column and I can't delete it. Please help me to delete the index column.

    const money = 2000;
    const interestRate = 20;
    const years = 25;

    let step = 1;
    let compoundInterest = money;
    let result = [];
    for (let i = 0; i < years; i++) {
      result.push({
        سال: step++,
        سرمایه: compoundInterest.toFixed(2),
        سود: ((compoundInterest * interestRate) / 100).toFixed(2),
        جمع: ((compoundInterest * interestRate) / 100 + compoundInterest).toFixed(2),
      });
      compoundInterest = (compoundInterest * interestRate) / 100 + compoundInterest;
    }
    console.table(result, ["سال", "سرمایه", "سود", "جمع"]);
Amir93
  • 5
  • 5
  • When you don't know the answer, why do you label it as repetitive? I would definitely find the answer, I wouldn't be idle to ask a repetitive question. – Amir93 May 29 '23 at 20:47

0 Answers0