Lipi Reference
Lipi

Functions

array.pop()

Removes the last element of the array and returns it.

Syntax

                array.pop(series array id) → series 
              

Arguments

id required series array

Return Type

series

Example


          //@lipi=2
indicator("array.pop Example", overlay=false)
values = array.from(1.0, 2.0, 3.0)
lastValue = array.pop(values)
// lastValue is 3.0 and the array now holds 1.0, 2.0
plot(lastValue + array.length(values), title="3 + 2", color=color.blue)