L11 — Arrays in Luau

ENTRY 11 // TABLES, INDEXING, AND LOOPS

Example: Array of Names



Output

Press the button to run the Luau program.

Example: Number Array

Calculate the total and average of a list of numbers.

Output

Press the button to run the number example.

JavaScript vs. Luau

JavaScript arrays commonly start at index 0. Luau arrays conventionally start at index 1. Luau tables can also store keys and values that are not part of a simple array.