spread es-toolkit
Creates a new function that spreads a parameter array into individual parameters of the function.
Usage
spread(func)
Use spread when you want to spread an array-form parameter into individual parameters to pass to a function.
This plays a similar role to JavaScript's spread operator (...), but it transforms the function to accept an array instead. This is useful in situations where you frequently use the apply method.
The this context is also maintained.
Parameters
The function to accept a parameter array spread into individual parameters.
Returns
Returns a new function that accepts a parameter array and passes it to the original function in spread form.
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.