rocinantealpha

reference / tables

put

Gives a name in a table a value: put counts "cat" 3. A name already there gets the new value.

counts = tableput counts "cat" 2put counts "owl" 1put counts "cat" 3print counts

It prints

{ "cat": 3, "owl": 1 }

How to write it

put table key value

Related