array.pop() - Pine Script Function
array.pop()
Section titled “array.pop()”Overview
Section titled “Overview”The function removes the last element from an array and returns its value.
Syntax
Section titled “Syntax”array.pop(id) → series <type>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| id | any array type | An array object. |
Returns
Section titled “Returns”The value of the removed element.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("array.pop example")a = array.new_float(5,high)removedEl = array.pop(a)plot(array.size(a))plot(removedEl)