utils

@cahil/utilsGlobalsfunction

External module: function

Index

Functions

Functions

partial

partial(func: function, …argsBound: any[]): function

Defined in src/function/partial.ts:22

Creates a function that invokes func with partials prepended to the arguments it receives.

example


const addNums = (a, b, c) => a + b + c
const addNumsTo5 = partial(addNums, 5)

addNumsTo5(1, 3) // => 9

Parameters:

func: function

The function to partially apply arguments to

▸ (…args: any[]): any

Parameters:

Name Type
...args any[]

▪… argsBound: any[]

The arguments to be partially applied

Returns: function

▸ (…remainingArgs: any[]): any

Parameters:

Name Type
...remainingArgs any[]