Merge Maps | MAP_MERGE

Syntax

MAP_MERGE( [...values] )

Parameters

values
Any number of MAP / OBJECT values.

Return Value

The combined MAP / OBJECT

Description

Merge MAP / OBJECT values into a single MAP / OBJECT. If the same key exists in more than one of the MAPS, the value contained in the last MAP is returned.

Examples

# ${a} is ["a" => 1, "b" => 2]
# ${b} is ["a" => 3, "c" => 4]
MAP_MERGE(${a}, ${b}) # returns ["a" => 3, "b" => 2, "c" => 4]