Repository navigation
ElementAt
Dennis Corvers edited this page Oct 23, 2026
·
1 revision
Returns the value at a specified 1-based position in an iterable.
value = values:elementAt(index)| Parameter | Type | Description |
|---|---|---|
index |
positive integer | 1-based position of the requested value. |
The value at index.
An index below 1, a non-integer index, or an index beyond the available values
raises an error. For tables iterated with pairs, position follows that
iterator's order, which is unspecified.
local selectedPlayer = LuaQ.from({
{ name = "Ada" },
{ name = "Bryn" },
{ name = "Cato" },
})
:elementAt(2)
-- selectedPlayer.name is "Bryn"- Home
- Getting Started
-
Functions
- aggregate
- all
- any
- concat
- contains
- count
- create
- createFrom
- deepCopy
- difference
- elementAt
- elementAtOrDefault
- first
- firstOrDefault
- flatMap
- foreach
- groupBy
- groupByResult
- indexOf
- intersect
- ipairs
- last
- lastOrDefault
- map
- max
- min
- pairs
- sequenceEquals
- single
- singleOrDefault
- sort
- sortBy
- sortByDescending
- sortDescending
- sum
- take
- takeWhile
- thenBy
- thenByDecending
- toLookup
- toMap
- toSet
- toTable
- union
- unique
- where
- zip
- Aliases