Merge branch 'master' into master
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
### Compose functions
|
||||
|
||||
Use `Array.reduce()` with the spread operator (`...`) to perform right-to-;eft function composition.
|
||||
Use `Array.reduce()` to perform right-to-left function composition.
|
||||
The last (rightmost) function can accept one or more arguments; the remaining functions must be unary.
|
||||
|
||||
```js
|
||||
@ -11,4 +11,4 @@ const multiply = (x, y) => x * y
|
||||
const multiplyAndAdd5 = compose(add5, multiply)
|
||||
multiplyAndAdd5(5, 2) -> 15
|
||||
*/
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user