dictionary<K, V>
dictionary<K, V>
Section titled “dictionary<K, V>”String-keyed (or typed-key) map. map<K,V> is the same emit. Access keys with ..
Syntax
Section titled “Syntax”dictionary<K, V> name = { {"Key", value}, {"Other", value2}};Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
K | type | Key type (usually string). |
V | type | Value type. |
Return value
Section titled “Return value”A map table.
Luau emit
Section titled “Luau emit”{ [K]: V }
Description
Section titled “Description”Initializer entries are {"Key", value} pairs, emitted as Key = value when the key is a string.
Read/write: stats.Coins → stats.Coins. Instance properties use the same ..
Example
Section titled “Example”dictionary<string, int> stats = { {"Coins", 100}, {"Gems", 50}};post(stats.Coins);Emits:
local stats: { [string]: number } = { Coins = 100, Gems = 50 }print(stats.Coins)