mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-06 10:36:45 +00:00
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:
parent
c39c733ff6
commit
72fe6956aa
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue