Tables as Lists: Coding lesson for kids
In “Tables as Lists”, children learn about fruits = {"apple", "banana"}; table.insert(fruits, "cherry"); fruits[1].
fruits = {"apple", "banana"}: A table can act like a list — curly braces hold the values. The first item is at index 1 by convention.
table.insert(fruits, "cherry"): Adds a new item to the end of the table.
fruits[1]: Gets the FIRST item — the Lua convention for list-style tables is to start at index 1, not 0. (You can use other indexes, but 1 is the standard.).
This lesson is part of Lua in Coding at Pearls Valley Academy — The language behind Roblox’s Luau.
Each lesson starts with a short narrated, animated explanation, then hands-on practice. A wrong answer gets a gentle hint, never a penalty, and children earn stars and pearls as they go.