spreadNew()

Passes an array as the arguments to a construct thusly allowing a variable number of arguments to be passed to the constructor.

This function is valid in v2.8.0 to v2.13.1. This function has been downloaded 22 times.

Parameters

{Function} constructor
Constructor function to be called with a variable number of arguments.
{Array} args
Array or array-like object that will be treated as the arguments to pass to constructor.

Returns

{*}
Constructed object.

Required Function

This function requires the following function which is included automatically:

  • slice()
    Slice does not modify the original array, but instead returns a shallow copy of elements from the original array.