Array.index_of
Array.index_of
Function
Returns the index of the first occurrence of the specified value.
Syntax
array.index_of(value)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| value | Any | No | None | The value to find. |
Return value
| Type | Description |
|---|---|
| Int | Returns the subscript if found; returns -1 if not found. |
Example
items = ['a', 'b', 'a'] result = items.index_of('a') // Output: 0 print result
Notes
- Comparisons use the BT value equality rule.