I will start by sharing the basic html and css used in this project and then walk through the javascript to discuss what is happening:
html:
css:
Javascript:
I first get all of my dom elements in a javascript const so I can manipulate them when I need to through the javascript dom method.
I have an array called data which holds the name and value for users.
now every time I call updateDom it should update my HTML to show the latest available data in my data array.
map array method, returns another map, it basically map every value to a new value depending on the function you provide to it, in the example below im doubling the money for every item and returning the name as it was using the spread operator "..."
updateDOm() is calling the function I used above.