Course · Section 9: Data Structures, Modern Operators and Strings · Lecture 111: The Spread Operator (...)
Implement `arrayReducer(state, action)` for list state: - `{ type: 'add', value }` appends. - `{ type: 'removeAt', index }` removes by index. - `{ type: 'updateAt', index, value }` replaces by index. - `{ type: 'move', from, to }` moves an element. All immutable.
+ 1 hidden test run on Submit.
A reducer over array actions centralizes immutable list updates, the pattern behind useReducer-managed lists.
Run your code to see results.