map.clear() - Pine Script Function
map.clear()
Section titled “map.clear()”Overview
Section titled “Overview”Clears the map, removing all key-value pairs from it.
Syntax
Section titled “Syntax”map.clear(id) → voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| id | any map type | A map object. |
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("map.clear example")oddMap = map.new<int, bool>()oddMap.put(1, true)oddMap.put(2, false)oddMap.put(3, true)map.clear(oddMap)plot(oddMap.size())