30 seconds of code

  Back to Home

collectInto

adapterfunctionarrayintermediate

Changes a function that accepts an array into a variadic function.

Given a function, return a closure that collects all inputs into an array-accepting function.

const collectInto = fn => (...args) => fn(args);