Repository navigation
Contains
Dennis Corvers edited this page Oct 23, 2026
·
1 revision
Determines whether an iterable contains a value equal to the requested item.
found = values:contains(item, comparer)| Parameter | Type | Description |
|---|---|---|
item |
any | Value to search for. |
comparer |
function(value, item) (optional) |
Returns true when the values are considered equal. |
true if a matching value is found; otherwise false.
Without a custom comparer, tables are compared recursively as sequences.
has is an alias.
local roster = LuaQ.from({
{ accountId = 41, name = "Ada" },
{ accountId = 58, name = "Bryn" },
})
local hasBryn = roster:contains({ accountId = 58, name = "Bryn" },
function(player, wanted) return player.accountId == wanted.accountId end)
-- true- 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