Fix overArgs example

This commit is contained in:
atomiks
2018-01-31 18:17:06 +10:00
committed by GitHub
parent 4b0dee99c5
commit df9438e6a8

View File

@ -9,11 +9,9 @@ const overArgs = (fn, transforms) => (...args) => fn(...args.map((val, i) => tra
```
```js
var func = overArgs(
function(x, y) {
return [x, y];
},
[square, doubled]
);
func(9, 3); // [81, 6]
const square = n => n * n;
const double = n => n * 2;
const fn = overArgs((x, y) => [x, y], [square, doubled]);
fn(9, 3); // [81, 6]
```