Repository navigation
Zip
Dennis Corvers edited this page Oct 23, 2026
·
2 revisions
Combines corresponding values from two iterables using an optional result selector.
zipped = source:zip(second, resultSelector)| Parameter | Type | Description |
|---|---|---|
second |
iterable | The iterable paired with the source. |
resultSelector |
function(valueA, valueB) (optional) |
Produces one output value from each pair. |
A deferred Enumerable that ends as soon as either input is exhausted.
Without a result selector, each output is a two-element table { valueA, valueB }.
The result selector receives values from the two inputs, not their source keys.
local attendance = LuaQ.from({
{ name = "Ada" },
{ name = "Bryn" },
})
:zip({ true, false }, function(player, checkedIn)
return { name = player.name, checkedIn = checkedIn }
end)
:toTable()
-- { { name = "Ada", checkedIn = true }, { name = "Bryn", checkedIn = false } }- 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