MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / totalExpense

Method totalExpense

assets/js/Budget.js:104–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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){

Callers 1

showBalanceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected