Gets the element at the given index, extending via a factory function if out of bounds.
Element type.
The array.
Non-negative index.
Factory called with index to create new entries.
The element at index.
index
If index is negative.
Gets the element at the given index, extending via a factory function if out of bounds.