Creates a function that accepts up to one argument, ignoring any additional arguments.
fn
, with just the first argument supplied.const unary = fn => val => fn(val);
['6', '8', '10'].map(unary(parseInt)); // [6, 8, 10]
JavaScript, Function
Creates a function that accepts up to n
arguments, ignoring any additional arguments.
JavaScript, Function
Creates a function that accepts up to two arguments, ignoring any additional arguments.
JavaScript, Function
Creates a function that invokes the method at a given key of an object, optionally prepending any additional supplied parameters to the arguments.