Arrays / Reference
alerta.array.lastindexof
TradingView-compatible spelling: array.lastindexof, runs without warnings
Returns the last index of a value in the array or -1 if not found.
alerta.array.lastindexof(id, value) → intParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
id | Array | Yes | — | Array handle. |
value | any | Yes | — | Value to search for. |
Returns
intExample
alerta.array.lastindexof
myArr = array.new_float(0)array.push(myArr, 1)array.push(myArr, 2)array.push(myArr, 1)idx = array.lastindexof(myArr, 1)Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.