How to add a new key and value for a table?

Started by Kenneth Law, Apr 06, 2021, 12:21 PM

Previous topic - Next topic

Kenneth Law

Give a situation that I have localed a table like
local table = { "a": 1, "b": 2, "c": 3 };
How can I add a new key and a new value for it then?
For example a new key which is "d" and a new value which is 4 so that the table will become { "a": 1, "b": 2, "c": 3, "d": 4 };