This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19.8
collection.concat( )

collection.concat( ) 


 

collection.concat ( value {; value2 ; ... ; valueN} ) -> Function result 
Parameter Type   Description
value  Number, Text, Object, Collection, Date, Boolean in Value(s) to concatenate. If value is a collection, all collection elements are added to the original collection
Function result  Collection in 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.

Example  

 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]



See also 

collection.combine( )

 
PROPERTIES 

Product: 4D
Theme: Collections
Number: 705251

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v16 R6

 
ARTICLE USAGE

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)