Skip to content

fx-flow v0.7.0 / pipe/strict / apply

Function: apply()

apply(fn, args)

apply<A, P>(fn, args): ReturnType<typeof fn>

Apply function fn to the arguments list args.

Type parameters

A extends AnyFunction

P extends any[]

Parameters

fn: A

args: P

Returns

ReturnType<typeof fn>

Example

typescript
apply(Math.max, [1, 2, 3, 4, 5]); // 5

More examples

Source

packages/core/src/pipe/strict/apply.ts:13

apply(fn)

apply<A, P>(fn): (args) => ReturnType<typeof fn>

Type parameters

A extends AnyFunction

P extends any[]

Parameters

fn: A

Returns

Function

Parameters

args: P

Returns

ReturnType<typeof fn>

Source

packages/core/src/pipe/strict/apply.ts:15

Released under the MIT License.