Skip to main content

array.extend(array)

Combines two arrays into one

Availability

Device + Agent

Parameters

Name Type Description
array Array An array to be appended to the current array, item by item

Returns

Nothing

Description

This method appends all the elements in the array passed as its parameter to the end of the target array. So if the target has ten items and the passed array five, then the target array will contain 15 items after the operation has completed.

Contrast extend() with the append() and push() methods, which simply add the passed array to the target as a single item.

Example Code