spread()

Calls a function while flattening first-level array-like arguments so as the spread those individual values and use them as individual arguments.

This function is valid in v2.3.0 to v2.24.3. This function has been downloaded 60 times.

Parameters

{Function} fn
Function to which the spread values will be passed.
{…*=} args Optional
Arguments that will be passed to fn. If any of the arguments are arrays or array-like they will be flattened and passed to fn so as the spread those values.

Returns

{*}
Return value after calling fn with the specified args.

Required Functions

This function directly requires the following functions which are included automatically:

  • isArrayLike()
    Determines if an object is an array or at least array-like.
  • slice()
    Slice does not modify the original array, but instead returns a shallow copy of elements from the original array.