local Table = {
["TABLE_info"] = "TABLE_response"
}
for i, v in pairs(Table) do
print(v)
end
local favoritefoods_table = {"hamburger", "spaghetti", "pizza", "potato chips"}
--the table--
for i, v in pairs(favoritefoods_table) do --loop through the table--
print(i) --print the number--
print(v) --print the value--
end
local myTable = {}
a = {}
x = "y"
a[x] = 10 -- put 10 in field "y"
print(a[x]) --> 10 -- value of field "y"
print(a.x) --> nil -- value of field "x" (undefined)
print(a.y) --> 10 -- value of field "y"
Note: [var] -> means var is optional
table.concat(table, [separator], [start index], [end index (inclusive)])
Concatenates the strings in the table based on the parameters given.
table.insert(table, [pos], value)
Inserts a value into the table at specified position.
table.remove(table, [pos])
Removes the value from the table.
table.sort (table ,[comp])
Sorts the table based on optional comparator argument.