merge (Merge objects)
$merge can be used to merge multiple objects into one new object. All object fields of the previous object will be overwritten.
Syntax
$merge(object1[,object2,...objectN]])
Parameter
Name |
Description |
object1 |
The first object |
object2 |
The second object |
objectN |
The nth object |
Return value
A merged object, but at least a copy of the first object.
Example
Syntax |
Variables |
Result |
$merge($var(a),$var(b)) |
a = { "name" : "Hans" , "country" : "Austria" } b = { "country" : "German" , "city" : "Munich" } |
{ "name" : "Hans" , "country" : "German" , "city" : "Munich" } |