Skip to content
Algo Trade Analytics Docs

map.remove() - Pine Script Function

Removes a key-value pair from the id map.

map.remove(id, key) → <value_type>
NameTypeDescription
idany map typeA map object.

The previous value associated with key if the key was present in the map, or na if there was no such key.

//@version=6
indicator("map.remove example")
a = map.new<string, color>()a.put("firstColor", color.green)oldColorValue = map.remove(a, "firstColor")
plot(close, color = oldColorValue)