Function: map.merge

Takes two maps, creates a copy of the first map, and adds the items from the second map to the copy.

For maps with the same key, the value from the first map is replaced by the value from the second map.

For example, if you have map1 = {key1: value1} and map2 = {key1: value2}, map.merge(map1, map2) returns {key1: value2}.

Arguments

Arguments
first The map to be merged into.
second The map to merge.

Returns

A copy of the first map with items added from the second map.

Raised exceptions

Exceptions
TypeError If first or second is not a map (dictionary).

Examples

You can use this function in an expression like this:

${map.merge(first, second)}