()
| 102 | |
| 103 | //total expense |
| 104 | totalExpense(){ |
| 105 | let total = 0; |
| 106 | if(this.itemList.length > 0){ |
| 107 | total = this.itemList.reduce(function(acc, curr){ |
| 108 | acc += curr.amount; |
| 109 | return acc; |
| 110 | }, 0) |
| 111 | } |
| 112 | this.expenseAmount.textContent = total; |
| 113 | return total; |
| 114 | } |
| 115 | |
| 116 | //edit expense |
| 117 | editExpense(element){ |