Capy-Bearer Documentation

array_merge

lib call

Capy

function array_merge(left : dval, right : dval) dval

Description

array_merge combines two dval values. It returns a new value.

For maps, values from right replace matching values from left. The function also merges lists.

Parameters

left : first value

right : second value

Return Values

a merged dval value

Example

Capy

var merged := array_merge(dval({"name": "Ada"}), dval({"role": "admin"}))
print(merged["name"], " ", merged["role"], "\n")