Since the definition of reduceRight wan't correct, the definition of reduce doesn't seem to be right either. Changed both to mdn's definition.

This commit is contained in:
Steve Mao 2017-04-10 21:10:56 +10:00
parent c39c733ff6
commit 72fe6956aa
No known key found for this signature in database
GPG key ID: EED733AB250010C0

View file

@ -800,7 +800,7 @@ An object that has a `concat` function that combines it with another object of t
## Foldable
An object that has a `reduce` function that can transform that object into some other type.
An object that has a `reduce` function that applies a function against an accumulator and each element in the array (from left to right) to reduce it to a single value.
```js
const sum = (list) => list.reduce((acc, val) => acc + val, 0)