4D v17.4

collection.concat( )

Home

 
4D v17.4
collection.concat( )

collection.concat( )  


 

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

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v17)
4D Language Reference ( 4D v17.1)
4D Language Reference ( 4D v17.2)
4D Language Reference ( 4D v17.3)
4D Language Reference ( 4D v17.4)