map.copy() - Pine Script Function
map.copy()
Section titled “map.copy()”Overview
Section titled “Overview”Creates a copy of an existing map.
Syntax
Section titled “Syntax”map.copy(id) → map<keyType, valueType>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| id | any map type | A map object to copy. |
Returns
Section titled “Returns”A copy of the id map.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("map.copy example")a = map.new<string, int>()a.put("example", 1)b = map.copy(a)a := map.new<string, int>()a.put("example", 2)plot(a.get("example"))plot(b.get("example"))