@at
Access an element by index in an array.
Returns: any
Syntax
Section titled “Syntax”@at(value index)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
value |
array |
Input value |
index |
number |
Zero-based index (negative counts from end) |
Examples
Section titled “Examples”# Access first elementset $arr [10 20 30]set $first @at($arr 0)
# Access last element (negative index)set $arr [10 20 30]set $last @at($arr -1)See Also
Section titled “See Also”- @slice — extract a sub-array