# copy

    value copy(value, deep)

Returns a shallow, or deep, copy of value.

A shallow copy only duplicates the containing (root level) array or dictionary, not its (nested child) values. A deep copy also duplicates every element value in an array and/or entry value in a dictionary, and any nested (child) values therein, and so on.

## Parameters

1. value — value to clone.
2. deep — optional, whether to create a deep copy, default is shallow.

## Returns

- a copy of value.