array.unshift() - Pine Script Function
array.unshift()
Section titled “array.unshift()”Overview
Section titled “Overview”The function inserts the value at the beginning of the array.
Syntax
Section titled “Syntax”array.unshift(id, value) → 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.unshift example")a = array.new_float(5, 0)array.unshift(a, open)plot(array.get(a, 0))