Takes a variadic function and returns a function that accepts an array of arguments.
...
) to map the array of arguments to the inputs of the function.const spreadOver = fn => argsArr => fn(...argsArr);
const arrayMax = spreadOver(Math.max);
arrayMax([1, 2, 3]); // 3
JavaScript, Function
Changes a function that accepts an array into a variadic function.
JavaScript, Function
Creates a function that accepts up to n
arguments, ignoring any additional arguments.
JavaScript, Function
Takes several functions as argument and returns a function that is the juxtaposition of those functions.