Fix overArgs example
This commit is contained in:
@ -9,11 +9,9 @@ const overArgs = (fn, transforms) => (...args) => fn(...args.map((val, i) => tra
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
var func = overArgs(
|
const square = n => n * n;
|
||||||
function(x, y) {
|
const double = n => n * 2;
|
||||||
return [x, y];
|
|
||||||
},
|
const fn = overArgs((x, y) => [x, y], [square, doubled]);
|
||||||
[square, doubled]
|
fn(9, 3); // [81, 6]
|
||||||
);
|
|
||||||
func(9, 3); // [81, 6]
|
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user