Course · Section 17: Modern JavaScript Development: Modules, Tooling, and Functional · Lecture 294: Declarative and Functional JavaScript Principles
Implement `amountReducer(state, action)` where an `add` action carries a numeric `payload` to add to the state number. Unknown actions return state unchanged.
+ 1 hidden test run on Submit.
The reducer adds the payload for an add action and returns the current state for all other action types, keeping it pure and total.
Run your code to see results.