Code styling
This commit is contained in:
@ -5,7 +5,7 @@ Creates a function that invokes the provided function with its arguments arrange
|
||||
Use `Array.map()` to reorder arguments based on `indexes` in combination with the spread operator (`...`) to pass the transformed arguments to `fn`.
|
||||
|
||||
```js
|
||||
const rearg = (fn, indexes) => (...args) => fn(...indexes.map(idx => args[idx]));
|
||||
const rearg = (fn, indexes) => (...args) => fn(...indexes.map(i => args[i]));
|
||||
```
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user