Version: v0.6.1 - Beta.  We welcome contributors & feedback.  THanks!

Map.copy

copy($useReferences = false)

Description

Copy the Map into a new Map.

Any elements that are Lists or Maps will also be copied, recursively.

If $useReferences is true, child List or Map objects will point to the same objects as the original.

$map1 = { a: 1, b: 2 };
$map2 = $map1.copy();

$map1.b = 11;
$map2.b = 22;

print($map1);
//= { a: 1, b: 11 }

print($map2);
//= { a: 1, b: 22 }