Returns the element at a specified index in a sequence or throws if the index is out of range. A negative index can be used to get element starting from the end.
The source iterable.
The zero-based index of the element to retrieve.
The element at the specified position in the source sequence.
const indexZero = elementAt([1, 2, 3], 0); // Will be 1const willBeNull = elementAt([1, 2, 3], 10); // Will throw.const last = elementAt([1, 2, 3], -1); // 3 Copy
const indexZero = elementAt([1, 2, 3], 0); // Will be 1const willBeNull = elementAt([1, 2, 3], 10); // Will throw.const last = elementAt([1, 2, 3], -1); // 3
TSource The type of the source iterable.
Returns the element at a specified index in a sequence or throws if the index is out of range. A negative index can be used to get element starting from the end.