Repository navigation
Take
Dennis Corvers edited this page Oct 23, 2026
·
2 revisions
Returns at most a specified number of values from the beginning of an
Enumerable.
prefix = source:take(count)| Parameter | Type | Description |
|---|---|---|
count |
non-negative integer | Maximum number of values to return. |
A deferred Enumerable containing no more than count values.
The count must be a non-negative integer. A count of zero produces an empty sequence; a count larger than the source returns all available values.
local nearbyPlayers = LuaQ.from({
{ name = "Ada", distance = 2 },
{ name = "Bryn", distance = 4 },
{ name = "Cato", distance = 8 },
})
:take(2)
:toTable()
-- Only the first two nearby players- 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