📕 Lesson 3 - Tables

Tables are the generic term for arrays and dictionaries. Arrays are one-based rather than zero-based, so the first item is [1]. You declare arrays and dictionaries with a single set of curly braces:

-- Example
local myArray = {"chips", "sparkling water", "salsa"}
local myDictionary = {
	snack = "chips",
	drink = "sparkling water",
	dip = "salsa"
}
print(myArray[1]) --> chips
print(myDictionary.dip) --> salsa

  
← Back