Update over.md
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: over
|
title: over
|
||||||
tags: adapter,function,intermediate
|
tags: function,intermediate
|
||||||
---
|
---
|
||||||
|
|
||||||
Creates a function that invokes each provided function with the arguments it receives and returns the results.
|
Creates a function that invokes each provided function with the arguments it receives and returns the results.
|
||||||
@ -14,4 +14,4 @@ const over = (...fns) => (...args) => fns.map(fn => fn.apply(null, args));
|
|||||||
```js
|
```js
|
||||||
const minMax = over(Math.min, Math.max);
|
const minMax = over(Math.min, Math.max);
|
||||||
minMax(1, 2, 3, 4, 5); // [1,5]
|
minMax(1, 2, 3, 4, 5); // [1,5]
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user