--- title: "merge (Merge objects)" slug: "calc-function-merge" updated: 2026-05-12T10:04:54Z published: 2026-05-12T10:04:54Z canonical: "docs.lobstersoftware.com/calc-function-merge" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # merge (Merge objects) > [!NOTE] > $merge can be used to merge multiple objects into one new object. All object fields of the previous object will be overwritten. > > > [!TIP] > > Tooltip > > > > Syntax: *$merge(object1[,object2,...objectN]])* > > > > | Parameter | Description | > > | --- | --- | > > | `object1` | The first object | > > | `object2` | The second object | > > | `objectN` | The nth object | > > > > Returns a merged object, but at least a copy of the first object. > > > > Example: $merge($el(5),$el(10)) – Returns a new object which is a merge of the value of element 5 and element 6. ## 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)) | ```plaintext a = { "name": "Hans", "country": "Austria" } b = { "country": "German", "city": "Munich" } ``` | ```plaintext { "name": "Hans", "country": "German", "city": "Munich" } ``` |