partial
Partially applies arguments to a function, returning a new function that accepts the remaining arguments.
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
fn | function | The function to partially apply |
a | A |
Returns
Section titled “Returns”function — A function waiting for the remaining arguments
Examples
Section titled “Examples”Create a specialised multiplier
Section titled “Create a specialised multiplier”Pre-fill the first argument to derive a specialised function.
Pre-fill multiple arguments
Section titled “Pre-fill multiple arguments”Supply several arguments up front, leaving only the last one open.
