Repository navigation
Sort
Dennis Corvers edited this page Oct 23, 2026
·
2 revisions
Sorts values in ascending order using Lua's < comparison.
ordered = source:sort()This method has no parameters.
A deferred Enumerable that buffers and sorts the source values when
enumerated.
Values must be comparable with Lua's < operator. Sorting is performed when
the result is enumerated, not when sort is called. order is an alias.
local orderedNames = LuaQ.from({ "Bryn", "Ada", "Cato" })
:sort()
:toTable()
-- { "Ada", "Bryn", "Cato" }SortDescending · SortBy · ThenBy · Functions
- 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