call
Invokes a function with the provided arguments and returns the result.
Equivalent to fn(...args) — exists as a stable, named surface for the
"apply function to args" operation. Use inside .map(call) over arrays
of thunks, or anywhere a value-position function-call is clearer than an
inline arrow.
Usage
call<A extends readonly unknown[], R>(fn: (...args: A) => R, ...args: A)
Invokes a function with the provided arguments and returns the result.
Equivalent to fn(...args) — exists as a stable, named surface for the
"apply function to args" operation. Use inside .map(call) over arrays
of thunks, or anywhere a value-position function-call is clearer than an
inline arrow.
Parameters
fn(...args: A) => Rrequired
the function to invoke.
argsArequired
the arguments passed to fn.
Returns
the value returned by fn.