Skip to content

array<T>

Collection

Ordered list. Also spelled vector<T>, LuaArray<T>, span<T>. Emits a Luau array table {T}.

array<T> name = { a, b, c };
NameTypeDescription
TtypeElement type.

A list.

{T}

Brace lists are arrays. Iterate with range-for. There is no std::vector::push_back — use Luau table APIs (table.insert) via :: if you wrap them, or index.

map<K,V> is not this — see dictionary.

array<string> names = {"Kartz", "Player1"};
for (string n in names) {
post(n);
}

Emits:

local names: {string} = { "Kartz", "Player1" }
for _, n in names do
print(n)
end

dictionary · range-for · vector