For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/function.md.

Function

after
Creates a new function that invokes the original function starting from the n-th call.
ary
Creates a new function that limits the number of arguments a function can accept.
asyncNoop
A function that asynchronously does nothing.
before
Creates a new function that limits the number of times a function can be called.
call
Invokes a function with the provided arguments and returns the result.
callAsync
Invokes a function returning a Promise with the provided arguments.
curry
Curries a function so it can be called with one argument at a time.
curryRight
Curries a function from right to left so it can be called with one argument at a time.
debounce
Creates a debounced function that delays the invocation of a function.
flow
Creates a new function that executes multiple functions in sequence.
flowAsync
Creates an async pipeline that awaits each step before passing the result to the next function.
flowRight
Creates a new function that executes the given functions in sequence from right to left.
identity
Returns the input value as is.
ifElse
Returns a function that branches between two functions based on a predicate.
memoize
Caches function results so it runs faster when called again with the same arguments.
negate
Creates a new function that inverts the return value of a function that returns true or false.
noop
An empty function that does nothing.
once
Creates a new function that limits a function to be executed only once.
partial
Creates a new function with some arguments pre-applied.
partialRight
Creates a new function with some parameters pre-applied from the right.
rest
Creates a new function that bundles parameters from a specific index into an array and passes them to the function.
retry
Retries a Promise-returning function until it succeeds.
spread
Creates a new function that spreads a parameter array into individual parameters of the function.
tap
Returns a function that runs a side-effect and returns the value unchanged.
throttle
Limits a function to be executed at most once per specified time interval.
unary
Creates a new function that limits a function to accept only the first parameter.
unless
Returns a function that applies a transform only when a predicate fails, otherwise returns the value unchanged.
when
Returns a function that applies a transform only when a predicate passes, otherwise returns the value unchanged.