Tables can act like arrays when they use consecutive numeric indexes.

Array Tables

array_tables.lua
local first = 
local count = #{first, "white", "black"}
local selected = ({first, "white", "black"})[2]

print("first=" .. first)
print("selected=" .. selected)
print("count=" .. count)
local first = 
local count = #{first, "white", "black"}
local selected = ({first, "white", "black"})[2]

print("first=" .. first)
print("selected=" .. selected)
print("count=" .. count)
local first = 
local count = #{first, "white", "black"}
local selected = ({first, "white", "black"})[2]

print("first=" .. first)
print("selected=" .. selected)
print("count=" .. count)
array-like table An array-like table stores ordered values at numeric indexes starting at one.