Build
Choose an initial count and write one function to add items and one to subtract them. Keep quantities non-negative.
Implement and test an item counter.
Read an input, change a value, and render an output after a click.
Build an inventory counter for a fictional repair club. The counter starts at eight units. Stock movements are allowed only as positive whole numbers.
Avoid keeping a separate variable and a separately edited display. Render from the same confirmed count after each action.
Run the checks below and write down what you expected, what happened, and one change you can demonstrate. Self-checks are practice evidence, not a verified grade.
Choose an initial count and write one function to add items and one to subtract them. Keep quantities non-negative.
Run the exported JavaScript locally. Test zero, a normal addition, and subtracting too many items.
Which rule did you enforce in code, and which rule did you explain in the interface?
Show a count, an Add action, and a Remove action. Decide what happens at zero.
Ask for an explanation of state and one test of its boundary.