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 Parameter | Type | Description |
---|---|---|
array | Array | The array to concatenate. |
value | any | The value(s) to concatenate |
Return value
Type |
---|
Array<any> |
Sample
Example | Result | Description |
---|---|---|
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
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article