klyn.collections.Array.operator[]
method
public native operator[](index as Int) as T
Description
Returns or replaces the element at the given index. Negative indexes are accepted and count from the end of the array.
import klyn.collections

values as String[] = String[2]
values[0] = "left"
values[-1] = "right"
print(values[0])      # left
print(values[1])      # right
Parameters
  • index Zero-based index, or a negative index from the end.
Throws
  • IndexException if index is outside the array bounds.