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

Function updateDOM

assets/js/ArrayMethods.js:65–77  ·  view source on GitHub ↗
(provideData = data)

Source from the content-addressed store, hash-verified

63}
64
65function updateDOM(provideData = data) {
66 main.innerHTML = "<h2><strong>Person</strong> Wealth</h2>";
67
68 provideData.forEach((item) => {
69 const element = document.createElement("div");
70 element.classList.add("person");
71 element.innerHTML = `<strong>${item.name}</strong> ${formatMoney(
72 item.money
73 )}`;
74
75 main.appendChild(element);
76 });
77}
78
79function formatMoney(number) {
80 return "$" + number.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, "$&,");

Callers 4

doubleMoneyFunction · 0.70
sortByRichestFunction · 0.70
showMillionairesFunction · 0.70
addDataFunction · 0.70

Calls 1

formatMoneyFunction · 0.85

Tested by

no test coverage detected