apply
apply() function
Applies function f
to the argument list args
.
declare function apply<F extends Arrow, T extends Parameters<F>>(f: F, args: T): ReturnType<typeof f>;
declare function apply<F extends Arrow, T extends Parameters<F>>(f: F): (args: T) => ReturnType<typeof f>;
Example
apply(Math.max, [1, 2, 3, 4, 5]); // 5
pipe(
repeat(10),
map(a => a * Math.random())
take(5),
apply(max)
);