4 ms·
It's easier to see what's going on when you consider the spread operator to be an operator working on the function not the parameters: const dotdotdot = <A
by sfvisser 5y ago
It's easier to see what's going on when you consider the spread operator to be an operator working on the function not the parameters:
const dotdotdot = <A>(f: Function) => (list: Array<A>) => f.apply(this, list)
dotdotdot(console.log)([10, 20, 30])
console.log(...[10, 20, 30])