Creates a function that only accepts a single argument, ignoring any additional arguments passed to it.
The function to wrap.
A new function that only takes the first argument.
const parse = unary(JSON.parse);parse('{"a":1}', 'extra'); // ignores 'extra', only uses the first argument Copy
const parse = unary(JSON.parse);parse('{"a":1}', 'extra'); // ignores 'extra', only uses the first argument
1.1.0
Creates a function that only accepts a single argument, ignoring any additional arguments passed to it.