Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const reducer = (dataStructure, reducer, initial = null) => {
- let acc = initial
- dataStructure.map(item => acc = reducer(acc, item))
- return acc
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement