@ -5,7 +5,7 @@ tags: adapter,function,intermediate
|
|||||||
|
|
||||||
Creates a function that accepts up to `n` arguments, ignoring any additional arguments.
|
Creates a function that accepts up to `n` arguments, ignoring any additional arguments.
|
||||||
|
|
||||||
Call the provided function, `fn`, with up to `n` arguments, using `Array.prototype.slice(0,n)` and the spread operator (`...`).
|
Call the provided function, `fn`, with up to `n` arguments, using `Array.prototype.slice(0, n)` and the spread operator (`...`).
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
|
const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
|
||||||
|
|||||||
Reference in New Issue
Block a user