insert()

Inserts a value into an array at the given position.

This function is valid in v2.14.1 to v2.23.0. This function has been downloaded 29 times.

Parameters

{Array} array
Array into which a value will be inserted.
{*} value
Value to insert into array.
{number} position
Position at which to insert the value within array. A negative value will mean that the position is counted from the end of array. A position of -0 means that value will be added to the end of array.

Returns

{Array}
A reference to array. This is useful when chaining.

Required Function

This function directly requires the following function which is included automatically:

  • insertInto()
    Inserts a value into an array at the given position.

Requiring Function

This function is directly required by the following function:

  • insertInto()
    Inserts a value into an array at the given position.