This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v19.8
collection.concat( )
|
collection.concat ( value {; value2 ; ... ; valueN} ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
value | Number, Text, Object, Collection, Date, Boolean |
![]() |
Value(s) to concatenate. If value is a collection, all collection elements are added to the original collection | |||||
Function result | Collection |
![]() |
New collection with value(s) added to the original collection | |||||
The collection.concat( ) method returns a new collection containing the elements of the original collection with all elements of the value parameter added to the end.
Note: This method does not modify the original collection.
If value is a collection, all its elements are added as new elements at the end of the original collection. If value is not a collection, it is added itself as a new element.
C_COLLECTION($c)
$c:=New collection(1;2;3;4;5)
$fruits:=New collection("Orange";"Banana";"Apple";"Grape")
$fruits.push(New object("Intruder";"Tomato"))
$c2:=$c.concat($fruits) //[1,2,3,4,5,"Orange","Banana","Apple","Grape",{"Intruder":"Tomato"}]
$c2:=$c.concat(6;7;8) //[1,2,3,4,5,6,7,8]
Product: 4D
Theme: Collections
Number:
705251
Created: 4D v16 R6
4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)