FANDOM


all( tbl )

Returns an iterator for all items in a sequence in a table, for use with for...in.

tbl
The table to iterate.

The all() function is used exclusively with for...in to iterate over all elements in a sequence in a table. Each value in the sequence is emitted in sequence order.

Specifically, all() starts with the element at index 1, then increments the index and emits each value until it finds no element assigned (nil).

Examples Edit

t = {1, 3, 5}
add(t, 7)
add(t, 9)

for v in all(t) do
  print(v)  -- prints 1, 3, 5, 7, 9
end

See also Edit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.