unary
Summary
Takes a function fn of any arity and returns version of it that takes exactly one parameter.
Examples
It easy to forget that parseInt can take a number and a radix:
1 2 3 4 | |
We can avoid this with unary:
1 2 3 | |
Parameters
| Name | Type | Description |
|---|---|---|
| fn | function |
Return
function