array<T>
array<T>
Section titled “array<T>”Ordered list. Also spelled vector<T>, LuaArray<T>, span<T>. Emits a Luau array table {T}.
Syntax
Section titled “Syntax”array<T> name = { a, b, c };Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
T | type | Element type. |
Return value
Section titled “Return value”A list.
Luau emit
Section titled “Luau emit”{T}
Description
Section titled “Description”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.
Example
Section titled “Example”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