partial es-toolkit
Creates a new function with some arguments pre-applied.
Usage
partial(func, ...args)
Use partial when you want to fix some arguments of a function in advance. Pre-provided arguments are placed at the front of the function, and arguments passed later are added to the back.
This is similar to the concept of currying, which is frequently used in functional programming. Unlike bind, it doesn't fix the this context.
You can use partial.placeholder to pass specific arguments later.
You can adjust the argument order using placeholders.
Parameters
The function to partially apply arguments to.
The arguments to pre-apply.
Returns
Returns a new function with some arguments pre-applied.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.