Skip to content
Dennis Corvers edited this page Oct 23, 2026 · 1 revision

Enumerable:all

Determines whether every value in an iterable satisfies a predicate.

Syntax

matches = values:all(predicate)

Parameters

Parameter Type Description
predicate function(value, sourceKey) Returns false to indicate a value does not satisfy the condition.

Returns

false if any predicate call returns exactly false; otherwise true.

Remarks

An empty iterable returns true. The predicate receives the source iterator key, not a 1-based position.

Example

local squadReady = LuaQ.from({
    { name = "Ada", level = 82 },
    { name = "Bryn", level = 76 },
})
    :all(function(player) return player.level >= 70 end)
-- true

See also

Any · Count · Functions

Clone this wiki locally