Creates a function that accepts up to two arguments, ignoring any additional arguments.
fn
, with the first two arguments given.const binary = fn => (a, b) => fn(a, b);
['2', '1', '0'].map(binary(Math.max)); // [2, 1, 2]
JavaScript, Function
Creates a function that accepts up to n
arguments, ignoring any additional arguments.
JavaScript, Function
Creates a function that accepts up to one argument, 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.