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.14.2. This function has been downloaded 2 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 requires the following functions which are included automatically:

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