Array-style Lua tables use numeric indexes starting at 1.

Numeric Lookup

numeric_lookup.lua
local index = 
local color = ({"red", "blue", "green"})[index]

print("index=" .. index)
print("color=" .. color)
local index = 
local color = ({"red", "blue", "green"})[index]

print("index=" .. index)
print("color=" .. color)
local index = 
local color = ({"red", "blue", "green"})[index]

print("index=" .. index)
print("color=" .. color)
one based index Read a value by putting the numeric position inside brackets.