concat

Modified on Fri, 18 Aug 2023

Description

Create a new array concatenating array with any additional arrays and/or values.

Syntax

concat(array, value)

Parameters

Input ParameterTypeDescription
arrayArrayThe array to concatenate.
valueanyThe value(s) to concatenate

Return value

Type
Array<any>

Sample

ExampleResultDescription
concat([1, 2, 3], 4)[1, 2, 3, 4]Create a new array by adding new value 4
concat([1, 2, 3], [4, 5, 6])[1, 2, 3, 4, 5, 6]Create a new array by adding list of values
concat([1, 2, 3], [[4, 5, 6]])[1, 2, 3, [4, 5, 6]]Create a new array by adding values as list

To view all the List functions, click here.

See Also