array.clear() - Pine Script Function
array.clear()
Section titled “array.clear()”Overview
Section titled “Overview”The function removes all elements from an array.
Syntax
Section titled “Syntax”array.clear(id) → voidParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| id | any array type | An array object. |
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("array.clear example")a = array.new_float(5,high)array.clear(a)array.push(a, close)plot(array.get(a,0))plot(array.size(a))