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.
Example
constindexZero = elementAt([1, 2, 3], 0); // Will be 1 constwillBeNull = elementAt([1, 2, 3], 10); // Will throw. constlast = elementAt([1, 2, 3], -1); // 3
Typeparam
TSource The type of the source iterable.
Returns
The element at the specified position in the source sequence.
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.
Example
Typeparam
TSource The type of the source iterable.
Returns
The element at the specified position in the source sequence.