Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 347 Bytes

review_of_reducers_and_pure_functions.md

File metadata and controls

10 lines (7 loc) · 347 Bytes

Review of Reducers and Pure Functions

One of the core concepts of Redux is the reducer. A reducer is simply a function that iterates over a collection of values, and returns a new single value at the end of it.

A simple example of a reducer is a sum function:

let x = [1,2,3].reduce((value,state)=>value+state,0)
// x == 6