The goal of this exercise is to simulate a shopping card. The result of the function is a console.log which prints the end state of the shopping cart. In this case a shopping card with one entry in the purchases array with the corrected (tax) price.
- Add items to cart
- Add 21% to item in chart
- Buy item: cart ---> purchases
- Empty card
- (bonus) Save the history of each action (state management)
Run node index.js
to execute the code.