Atom

collection.merge()

Combines ordinary collections in argument order.

Signature

collection.merge(first, second, ...rest)

Parameters

At least two arrays, dictionaries or hybrid tables.

Returns

New collection. Homogeneous inputs retain their kind. Mixed input yields a hybrid.

Behavior

Appends sequence elements and applies associative keys. Later keys replace earlier values without moving their positions.

Errors

Unsupported inputs or invalid associative keys.

Example

Atom
use collection
assert(collection.merge({x = 1}, {x = 2}).x == 2)