Course · Section 17: Modern JavaScript Development: Modules, Tooling, and Functional · Lecture 294: Declarative and Functional JavaScript Principles
Implement `counterReducer(state, action)` where `state` is a number and `action.type` is `inc`, `dec`, or `reset`. Unknown actions return the state unchanged.
+ 1 hidden test run on Submit.
A reducer is a pure function from (state, action) to the next state. Each case computes a fresh value, and unknown actions fall through to return the state unchanged.
Run your code to see results.