Skip to content

table

Tables can be used as arrays:

local example = {1,2,3,4}

Iterating an array:

for index, value in example do
print(index, value)
end

Tables can be used as dictionaries / maps:

local example = {key1 = "value1", key2 = "value2"}

Iterating a dictionary:

for key, value in example do
print(key, value)
end