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

Function calculateWealth

assets/js/ArrayMethods.js:49–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47}
48
49function calculateWealth() {
50 const wealth = data.reduce((acc, user) => (acc += user.money), 0);
51
52 const wealthE1 = document.createElement("div");
53 wealthE1.innerHTML = `<h3> Total Wealth: <strong>${formatMoney(
54 wealth
55 )}</strong></h3>`;
56 main.appendChild(wealthE1);
57}
58
59function addData(obj) {
60 data.push(obj);

Callers

nothing calls this directly

Calls 1

formatMoneyFunction · 0.85

Tested by

no test coverage detected