app.js
// Show total amount for expenses on UI
Show total amount for expenses on UI
Show total amount for expenses on UI
showTotal(){
    let total = 0;
    for(let i = 0; i < this.expenseObj.length; i++) {
      let row = this.expenseObj[i];
      total = total+Number(row.amount);
    }
    this.uiExpenses.innerText = Number(total).toFixed(2);
    this.totalExpenses = total;
  }
showTotal ( ) { let total = 0 ; for ( let i = 0 ; i < this . expenseObj . length ; i ++ ) { let row = this . expenseObj [ i ] ; total = total + Number ( row . amount ) ; } this . uiExpenses . innerText = Number ( total ) . toFixed ( 2 ) ; this . totalExpenses = total ; }
Show total amount for expenses on UI
Show total amount for expenses on UI