Atom

Indexing

Indexing reads a particular value from a collection or text. Choose a position for a sequence and a key for a dictionary.

Look up a key at runtime

The variable key holds the name to look up.

Atom
player = {health = 90}
key = 'health'
print(player[key])
Output
90

Brackets let the program decide which field to read. See get() to provide a fallback.