klyn.collections.ArrayList.operator[]
method

    public native operator[](index as Int) as T

Description

Gets the element at the given index. Indexed assignment replaces an existing element; assigning at index `size` appends one element without allowing holes in the list.

    data = ArrayList<Int>()
    data[0] = 10    # equivalent to data.add(10)
    data[0] = 20    # replaces the first element
    print(data[0])  # 20

Parameters

- index Zero-based index.

Throws

- IndexException if index is invalid.